![]() |
![]() |
Russ,
This is a long-winded answer to your request,
but it will server as a How-To for the next person. This is also one way
to do it. I hope it helps you.
I've implemented a 2-page checkout in MV 3.08 (checkout.html
and checkout2.html). The first page is basically the standard
checkout.html from the simple demo, with some modifications, of course.
The second page is a last chance before the credit card txn is processed.
This way all the field checks are done on the first page. Here's a
step-by-step:
- Make a copy of checkout.html. For this example it is
named 'checkout2.html'.
In checkout.html:
- Set your 'successpage' to the name of the next page in your
multi-page checkout.
- Make sure your order profile is set to the
profile at the bottom of this page.
(This should have already been set to this
in the demo.)
<form action="[process-target _self secure]"
method="POST"> <input type=hidden name=mv_session_id value="[data session id]"> ... <input type="hidden"
name="mv_doit" value="refresh">
<input type="hidden" name="mv_orderpage" value="ord/checkout"> <input type="hidden" name="mv_order_report" value="ord/report"> <input type="hidden" name="mv_successpage" value="ord/checkout2"> <input type="hidden" name="mv_failpage" value="special/needfield"> <input type="hidden" name="mv_order_profile" value="checkout_profile"> You could also do this at the end of the checkout_profile
below with:
&set=mv_successpage ord/checkout2
- You should have a button similar to this.
(This should have already been set to this in the demo.) [set Place
Order!]
mv_todo=submit [/set] ... <input type=submit name=mv_todo
value="Place Order!">
- To indicate that this is not the last page in the checkout
process you need to indicate '&final=no' at the end of the checkout
profile. However, '&final=no' generates the error 'Error:
&final=no' in MV 3.08. There appears to be an error in
'Order.pm'. There are two workarounds.
One is to remove the '&final' altogether from the
checkout_profile. That is, remove any reference to '&final=yes' or
'&final=no'. Here is a basic version of my
checkout_profile:
(I've removed any credit card info 'required' directive here,
but the credit card info IS entered on this page.
I've also left in the shipping mode check so that you can see
where things go.)
[set
checkout_profile]
name=required address=required city=required state=required zip=required country=required email=required mv_shipmode=required ... [perl values config]
$country = $Safe{'values'}->{country}; $shipmode = $Safe{'values'}->{mv_shipmode}; if ($country =~
/^USA$/i)
{ $shipmode_ok = ($shipmode =~ /^(usa1|usa2)$/); } $out = <<EOF;
&set = mv_shipmode_mismatch $shipmode_ok EOF return $out; [/perl] &fatal=yes
[if value email] email=email &set = mv_email [value email] [/if] [/set]
The second workaround involves patching 'Order.pm'. Search this maillist for a posting with the subject "FIX: Error: &final=no, but mv_successpage is set" for the patch. I haven't tried the patch, so I can't speak to it. If you do install the patch you then should be able to rightly use '&final=no' in checkout.html. Next, in checkout2.html:
- Stripped out all the input fields and order information from
checkout2.html that is not relevant. Checkout2 really just displays some
text about proceeding with the credit card authorization by clicking the <Pay
for Order!> button. The remaining relevant stuff is:
- The start of my form declaration looks like:
<form action="[process-target _self secure]"
method="POST">
<input type=hidden name=mv_session_id value="[data session id]"> ...
<input type="hidden" name="mv_doit"
value="refresh">
<input type="hidden" name="mv_orderpage" value="ord/checkout"> <input type="hidden" name="mv_order_report" value="ord/report"> <input type="hidden" name="mv_failpage" value="special/needfield"> <input type="hidden" name="mv_order_profile" value="receipt_profile"> Don't set the 'successpage'
here, and call the checkout profile something different than the profile on the
previous checkout page. Here it is called 'receipt_profile'. (I
don't know if the different names are really required. I read a mail post
that said there are navigation problems with the <back> button if they are
named the same, but I am not sure of this.)
- You should have a button similar to
this:
[set Pay for Order!]
mv_todo=submit [/set] ...
<input type=submit name=mv_todo value="Pay for Order!"> - And finally, use '&final=yes' to indicate that this is
the last page in the checkout process. After this page the receipt will be
displayed.
[set receipt_profile]
...
&fatal=yes
&final=yes [/set] I hope I haven't left anything out.
Following the above example you shoule be able to make a checkout process of any
number of pages.
Cheers,
Gerard ------------------------------ Gerard Olszowiec Entity Software gerard@entitysoftware.com www.entitysoftware.com
|