Problem with shipping amount on email : LUSENET : S-Mart Shopping Cart : One Thread

Hi, I have been struggling with this one for days!!! When a quantity of more than 1 of an item is selected the shipping is processed properly on the "check cart routine", "checkout routine", and "buy routine", it even shows it right on the "you have succesfully ordered" page.

The problem is in the e-mails, the order shipped to the vendor and the customer both show the shipping re-calculated as if only a quantity of 1 was ordered. But it still shows the correct quantity ordered.

I think that the .cfg file is right because it figures it out correctly on the order pages, and I know the e-mail shipping formula is embedded in the .cgi file but I don't know enough about .cgi to tell if something is wrong.

Any suggestions? Thanks.

-- Marc Burnell (, January 10, 1998


Soory I can't help - but to confirm there is both a shipping and a tax calculation problem. I have slected tax=1 (tax by state) and Multiship=1 (various shipping methods to choose from) The both calculate everything correctly in all Web Pages outputs but they both send incorrect info via email (to both the customer and the merchant). In the case of tax - If AZ is selected - it calulates the tax correctly but leaves it out of the order total on the emails. In the case of shipping - If the shipping database has a value of say fedex +$ 3.00 and the customer selects that option this amount is correct in the web pages but is doulbled ($6.00) in the emails.

-- denny ladwig (, January 17, 1998.

I have noticed the same thing as Denny Ladwig wrote above. As a solution to the shipping being doubled in the receipt email, insert

$shipamt ="0";

above if ($shipping eq '0') {# Print Nothing}

Does anyone have a solution for the tax problem that Denny described?

-- Rusty McKinley (, February 02, 1998.


Problem with the shipping by item not being the same in the e-mail but OK on the HTML

I have struggled with the shipping by item for a few hours :-( and too a look in the cgi !!! As I am new to cgi and programing it took me a little longer than it should but I learnt a lot and corrected the problem ! (I hope)

Hope you understand - but I am sure you will

If you look at the cgi and the mail part you will see this part

print MAIL "----------------------------------------------------------------------\n"; print MAIL "Subtotal:"; if (index($totalprice,".") >= 0) { ($left,$right) = split(/\./,$totalprice); if (length($right) == 0) { $totalprice = $totalprice . "00"; } elsif (length($right) == 1) { $totalprice = $totalprice . "0"; } } else { $totalprice = $totalprice . ".00"; } print MAIL sprintf "%57.57s", "\$$totalprice\n";

if ($shipping eq '0') { # Print Nothing } elsif ($shipping eq '1') { my($low,@prices,$price); @prices = sort number keys %shipping; $low = $prices[0]; foreach $price (@prices) { if (($price > $low) && ($price <= $totalquant)) {$low = $price};

NOTE the last line

if (($price > $low) && ($price <= $totalquant)) {$low = $price};

This is my modification in the script the > are the wrong way around - I change this twice once on the mail to the client and one for the recite

Hope this is of help - thanks for a brilliant script


-- Andrew J Bruce (, February 07, 1998.

Hi, I guess I should clarify my original problem. The shipping method that I am attempting to use is ship by weight. But, just to make sure i tried this fix on the .cgi in the ship by weight section and it doesn't seem to change anything. What exactly does the "<" do? I tried switching it both ways and it doesn't change anything in the outcome. Please...Does anyone have any suggestions? This is driving me crazy! Thanks,

-- Marc Burnell (, February 08, 1998.

Moderation questions? read the FAQ