[ic] Add weight to shipping

Francisco Sánchez interchange-users@interchange.redhat.com
Sun Feb 24 14:06:01 2002


----- Original Message -----
From: "Ed LaFrance" <edl@newmediaems.com>
To: <interchange-users@interchange.redhat.com>
Sent: Sunday, 24 February, 2002 17:13
Subject: Re: [ic] Add weight to shipping

[...]
>
> Briefly, two things come to mind:
>
> 1. You could push a 'packaging' item into the cart a checkout, which costs
> 0 but weighs 100 grams.  This could be done with Perl on the checkout
page,
> or using the [add-item] usertag I wrote a while ago (it is floating around
> in the list archives somewhere). You would want to modify the checkout
page
> so that the user cannot remove this 'item', and that every time they go to
> checkout is it added if not already present in the cart.
>
> 2. You can tally the weight with your own code on the checkout page, then
> add 100 grams, and use the final total as the criterion in your shipping
> file, instead of the current method of having the shipping routines tally
> the weight.
>
> I'll watch this thread if you decide to approach it one of these ways and
> are looking for some code examples. Meanwhile, maybe someone else knows of
> an existing Interchange mechanism for doing this...
>
> - Ed L.

Thanks Ed for your answer.

To be fair, I know a way to do it, but I just wanted to make it "beautifully
integrated" with interchange, in case there was a way, as with adding a
fixed money amount to each order.

My idea is very simple: lower every level of the shipping table in X grams.
That is, if the Post Office has a scale that goes 0-50, 51-100, 101-200,
201-350, 351-1000 and so on, I will lower that scale by  X (being X the
weight of the envelope).  Let us suppose the envelope weighs 25 grams (the
100 of my former message was asuposition, 25 is much closer), the scale I
would use would be 0-25, 26-75, 76-175, 176-325, 326-975, and so on...

This will do it.

Regards,

Francisco