Jump to content


This topic is now archived and is closed to further replies.


Adding a number to a set value

Recommended Posts

I have a shopping cart system set up and I want to have a button that adds $4.00 to the total if the shipment is going international. I would like to know if there is a "add" command or something like that, that I can have this button point to, to add $4.00 to the total value of the shipment. This is the cart code as far as the money values go.

                        $totalvalue = $totalvalue + ($item["price"]*$ses_quan);
$subtotal = ($item["price"]*$ses_quan);
$shipping = 3.50 + ($totalvalue / 18.00 * 1.00);
$finalvalue = $totalvalue + $shipping

I would like to add $4.00 only on international shipments. Can someone tell me how to go about it and if there is a way to add that as a variable like..  $finalvalue = $totalvalue + $shipping + $international .... But how would I get it to figure the variable international bc I only want it to be $4.00 on certain shipments. Thanks in advance.


Share this post

Link to post
Share on other sites
The way I would do it -- depending on the cart system -- is look where it defines the tax rate..  then after the tax rate is figured out throw something like this..

if ($location == "international") {
$shipping = ($shipping) + ('4.00');

Something similar should work...

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.