Kryptronic Software Support Forum

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.

#1 11-17-2008 16:46:06

FusionLLC
Member
Registered: 09-16-2003
Posts: 82

Additional Shipping or Handling for more than 1 product ??

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

 

#2 11-17-2008 17:21:35

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Additional Shipping or Handling for more than 1 product ??

Not a problem.  First, calculate the per item surcharge near the beginning of the script like this:

Code:

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:

Code:

} 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.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

Board footer