[ic] Shipping calcs with gift certificates

John Young john_young at sonic.net
Thu Aug 5 16:17:14 EDT 2004

Bob Puff at NLE wrote:

> I've got a cart that uses gift certificates (called Donations).  The 
> shipping formula is based on the total amount of the order, not by 
> weight.  ($1-$50 is $5, $51-$100 is $10, etc..)
> The problem is the customer doesn't want the donation amount (gift 
> certificate) to add in to the formula used to calculate shipping.  So if 
> the cart has $100 of product and $50 of gift certificate, they want the 
> shipping formula to reflect the amount based on $100.
> Would this require some perl in the catalog.cfg, or where (and what) 
> would this entail?

You might want to have your shipping table (shipping.asc or whatever)
utilize a usertag/subroutine to calculate shipping (it could also do the
tiered pricing you mention above instead of doing that via separate
shipping.asc entries).

In that same routine, you could handle/omit gift certificates.  I
assume there is something about your gift certificates that identify
them as such.

You can loop through the items in the cart with:

     for my $item (@$Items) {
         Add to shipping_total unless gift certificate
         Cart data in this loop is accessible as $item->{quantity}

Use the [dump] tag if you are not familiar with the @Items structure
and contents.

-John Young

More information about the interchange-users mailing list