Is it Possible for shipping to be like $4.00 for first item and then each additional item $0.99?

greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread

Does anyone know how to edit the script like that? Any help would be appreciated. Thanks!

-- Ekin (hsiehpaul@hotmail.com), January 25, 2000

Answers

You could add something like the following to the area where it calculates shipping.

If $numitems (or whatever that variable is- i don't remember) eq '1' then { $shipamt = "4.00" }

then,

if $numitems >= '1' let $numaddlitems = $numitems-1 $shipamt = "4.00" + ($numaddlitems * (asterick) .99)

I know that is next the exact text you would use but it is the right general idea. If you play with that and put in the right variables and context it will work correctly for you and serve your needs.

Have a good one!

-BP

-- BP (bppilot@aol.com), January 26, 2000.


Hi-

It is relatively easy to add a handle charge, the trick is to get your cart to read 0 when it is empty. It works to a degree and is almost there, but you can try/modify it. If you get it 100% let me know.

elsif ($shipping eq '3') {

my($low,@weights,$weight);

@weights = sort number keys %shipping;

$low = $weights[0];

foreach $weight (@weights) {

if ($weight > $low && $weight <= $totalweight) {$low = $weight};

} #This is the modification

if ($totalweight != '0') #work in progress

{ $shiphandle = '3.55' };

$shipamt = $shipping{$low}+$shiphandle; #End Modify $totalprice += $shipamt;

print "\$ $shipamt\n";

}

Hopefully this will help. Also hopefully the carriage returns worked as I set them. This BBS can be difficult with returns :-)

-- Stephen Warriner (stephen@mvweb.com), January 26, 2000.


Hi,

In your "smart.cfg" file set shipping to "1" as shown below.

# Shipping #######################

# 0 = No shipping # 1 = Shipping by number of items # 2 = Non-variable shipping # 3 = Shipping by weight # 4 = Shipping by price

$shipping = "1";

Then set the shipping as below.

# For shipping by number of items # It works like this (20,'20.00',11,'10.00',6,'5.00') For less than 20 items, charge $20.00. # For 6 - 10 items charge $10.00, and so on if ($shipping eq '1') { %shipping = ('6','8.95','5','7.96','4','6.97','3','5.98','2','4.99','1','4.00','0' ,'0.00'); }

You can add to the number of items shipped. Make sure you keep it in the same format.

Jim

-- James L. Farmer (jim@team-blankets.com), January 26, 2000.


Moderation questions? read the FAQ