[interchange-cvs] interchange - pajamian modified dist/standard/include/checkout/initialization
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Wed Aug 13 04:52:49 UTC 2008
User: pajamian
Date: 2008-08-13 04:52:48 GMT
Modified: dist/standard/include/checkout initialization
Log:
Provide reasonable defaults for shipping mode and country at checkout to avoid "not enough information" errors.
Revision Changes Path
1.2 interchange/dist/standard/include/checkout/initialization
rev 1.2, prev_rev 1.1
Index: initialization
===================================================================
RCS file: /var/cvs/interchange/dist/standard/include/checkout/initialization,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- initialization 25 Apr 2004 17:07:49 -0000 1.1
+++ initialization 13 Aug 2008 04:52:48 -0000 1.2
@@ -11,11 +11,23 @@
return $Scratch->{old_browser} ? 'Not a DHTML browser' : 'DHTML browser';
[/calc] -->
-[perl tables="products"]
+[perl tables="products country"]
## This section sets the shipping, handling, taxing, and payment
## initializations, as well as browser check
+
+ # Initialize country:
+ $Values->{country} ||= $Variable->{SHIP_DEFAULT_COUNTRY};
+
+ # Initialize shipmode:
+ if ($Values->{mv_shipmode} eq 'default') {
+ my $shipmode = $Tag->data('country', 'shipmodes', $Values->{country});
+ $shipmode =~ s/^\s+//;
+ $shipmode =~ s/\s.*//;
+ $Values->{mv_shipmode} = $shipmode;
+ }
+
## Start with payment mode if none there
$Values->{mv_order_profile} ||= $Variable->{DEFAULT_PAYMENT_MODE}
||'credit_card';
More information about the interchange-cvs
mailing list