[ic] Help Free Shipping

Jerry interchange-users@interchange.redhat.com
Sat Apr 20 07:18:00 2002


> we would like to offer free ground shipping for our customers if the order
> total exceeds the amount of $100.00.
> I have implemented it in the shipping.asc and it seems to work in the
> shopping cart, but when I want to display
> all the shipping options (through the shipping function) at
> checkout it does
> not display the ground shipping (upsg)
> when the order is more then $100.00.

  [SNIP SHIPPING.ASC INFO]

Interchange can't handle offering free shipping based on
PRICE but charge shipping based on WEIGHT since the
method is set in the first line of any particular method.

Thanks to Mike Heins, we found you can set the method with
a variable and get around this. Here's how we offer
free UPS Ground shipping on orders over $200.00

In catalog.cfg, add the following variables.

Variable       FREE_SHIPPING_LEVEL 200
Variable       FREE_OR_WEIGHT <<EOR
[calc]
    my $subt = q{[subtotal noformat=1]};
    return 0 if $subt >= $Variable->{FREE_SHIPPING_LEVEL};
    return 'weight';
[/calc]
EOR

Next, here's a snipet of our shipping.asc file that includes
the free ups ground shipping.

code	description	criteria	min	max	formula	query	opt
0	No shipping	weight	0	99999999	e No shipping mode selected.
default	No shipping	weight	0	99999999	g PriceDivide

upsg	UPS Ground	__FREE_OR_WEIGHT__	0	0	e Nothing to ship!		{'PriceDivide' =>
"1",'adder' => "3.00",'ups' => "0",'ui_ship_type' =>
"UPSE:GNDRES",'at_least' => "5",}
upsg	UPS Ground	__FREE_OR_WEIGHT__	0	150	f [ups-query zip="[either][value
zip][or][var SHIP_DEFAULT_ZIP][/either]" mode="GNDRES" weight="@@TOTAL@@"]
{'PriceDivide' => "1",}
upsg	UPS Ground	__FREE_OR_WEIGHT__	150	999999	e @@TOTAL@@ lbs too heavy for
UPS

3ds	UPS Three Day	weight	0	0	e Nothing to ship!		{'PriceDivide' =>
"1",'adder' => "3.00",'ups' => "1",'ui_ship_type' => "UPSE:3DS",'at_least'
=> "5",}
3ds	UPS Three Day	weight	0	150	f [ups-query zip="[either][value zip][or][var
SHIP_DEFAULT_ZIP][/either]" mode="3DS" weight="@@TOTAL@@"]		{'PriceDivide'
=> "1",}
3ds	UPS Three Day	weight	150	999999	e @@TOTAL@@ lbs too heavy for UPS

Lastly, we display the shipping methods on the checkout pages with:

<td align="right"><b>Shipping method</b></font><b></td>
<td colspan="3">
		<SELECT NAME=mv_shipmode>
		[loop option=mv_shipmode
			list=|[data table=country key='[default country US]' col=shipmodes]|
			]
		<OPTION VALUE="[loop-code]"> [shipping-desc [loop-code]]
		[/loop]
		</SELECT>
</td></tr><tr><td>&nbsp;</td>
<td colspan="3">
[seti isfree][subtotal noformat=1][/seti]
[if scratch isfree >= 200]<font face="arial, Verdana, Helvetica" color="red"
size="-1">
[if value country eq US]
<b>FREE UPS Ground Shipping for Continential US</font>[/if]
[/if]<
/td>

Apply the changes and it should work. One note is that if we tried
to display the actual changes inside the drop down methods select,
it broke things and wouldn't display the ups ground stuff.

This is what works for us anyway...

Jerry Uphoff
jerry@digitalfm.com