You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
One of our clients has custom shipping set up with a tiered structure (every $20) similar to this:
---------------------------------------------
elsif ($item_subtotal > "45.00" && $item_subtotal <= "55.00")
{
$ship_total = "12.00";
$ship_display = "$ship_meth_name - $currency_symbol$ship_total";
...
---------------------------------------------
and also has a Volume Price Scheme for each product like this:
1-2:9.99;3-5:8.99;6:7.99
He would like to charge an additional $2 per product for every product over 1 but I cannot figure out how to add that with it also using the 'Calculation on total item cost'.
Help?
Offline
Not a problem. First, calculate the per item surcharge near the beginning of the script like this:
my $price_per_item = 2.00; my $surcharge = 0; ######### ######### Figure out what the per item surcharge will be by ######### multiplying the quantity by the price per item, excluding ######### the first item. ######### $surcharge = ($price_per_item * ($item_quantity-1));
Then, add that surcharge to each shipping price and format it to 2 decimal places before making the $ship_display, like this:
} elsif ($item_subtotal > "45.00" && $item_subtotal <= "55.00") {
$ship_total = 12.00 + $surcharge;
$ship_total = sprintf("%.2f", $ship_total);
$ship_display = "$ship_meth_name - $currency_symbol$ship_total"
} elsif {
...That should do it.
Offline