[ic] Read variable in [perl][/perl] tags

frank frank at goldissue.com
Wed Dec 31 06:23:26 EST 2003

Danilo Ingami wrote:

> Hi list user,
> I've a simple problem (not for me of course). I need to calculate the 
> insurance cost for a shipping.
> I use the weight method to calculate the amount of shipping and it 
> works fine.
> For calculate the total cost of the order I need to apply a 
> percentage, with at least a minimum cost,  to the subtotal of the order.
> I think to do this with perl code in the checkout page, but I don't 
> know the manner to read the value of the
> [subtotal], [salestax]  and [shipping] ic tags within the 
> [perl][/perl], and of cource how to get out the result from there.
> I had read a lot of documentation, but I don't find what I'm looking 
> for. Can anyone point me in the right direction?
> Many thanks an happy new year to everyone.
> Danilo
Hi Danilo,

I didn't know the answer until two days ago where I had to display the 
total cost on the receipt (which is inclusive of tax) but show what 
proportion was actually tax.

    <td colspan=3>
    <td align=right>
sub subtotalgst {
     my($subtotal,$x) = @_;
    return '$'.sprintf("%.2f",$subtotalgst);


I think the answer to your question is that the subroutine subtotalgst 
uses the [total-cost] already in use on the receipt.

Thats a good idea by the way. I have included insurance in the shipping 
calculation which is a modification of the ups_query tag.

I may actually display insurance separately if I can find a logical way,


Frank Reitzenstein.

More information about the interchange-users mailing list