php to workout shipping in basket sumary

leeg

Avatar: leeg

2010-08-29 13:15

I have this code in my product description and it works great

<strong>Delivery</strong> on this item would be



<?php

$first_number 
$aData[sPrice];
$second_number 0.10;
$third_number 0.50;

$sum_total $first_number $second_number $third_number;

$total_spent $aData[sPrice];
$discount_total 50;

if (
$total_spent $discount_total) {
print(
"FREE");
}
else if(
$total_spent $discount_total) {
echo 
"&pound;";
print 
number_format($sum_total2'.''');
}

?> 


What i want is to add the same code to my basket summary, sililar to this


So far the shipping cost of your order would be


<?php

$second_number 
0.10;
$third_number 0.50;

$sum_total $aData[sProductsSummary] * $second_number  $third_number;

$total_spent $aData[sProductsSummary];
$discount_total 50;

if (
$total_spent $discount_total) {
print(
"FREE");
}
else if(
$total_spent $discount_total) {
echo 
"&pound;";
print 
number_format($sum_total2'.''');
}

?> 



But this isn't working, any suggestions?


All i want is to show this as text, it doesn't need to carry on right through checkout because i use mals ecommerce to complete my cart which works out my shipping at 10% item value + 50p, orders over &#163;50 ship free

» Quick.Cart v3.x

http://www.boatandtackle.co.uk

leeg

Avatar: leeg

2010-08-31 11:54

no one?

http://www.boatandtackle.co.uk

leeg

Avatar: leeg

2010-09-01 09:51

does any one reply on here?

http://www.boatandtackle.co.uk

beholder

Avatar: beholder

2010-09-01 11:42

Hey man, your code is literally worthless here. One would have to analyze it, analyze QuickCart and then post the lenthy solution. NOT EASY.
That's why no one bothered to answer. You also clearly didn't specify what do you want to do with the code.

leeg

Avatar: leeg

2010-09-01 20:00

are ok, he's more of an idea

If you look at a product on my site http://www.boatandtackle.co.uk/38,sakuma-545-manta-extra-hooks-10pk.html it tells you the price of shipping for that item. The shipping price is calculated using the code above... 10% of basket total + 50p unless it's greater than &#163;50 then it is free.

What i wanted with the above code is to show the total shipping on my basket page with the same formula 10% of basket total + 50p.

The code above works on the product page, but on the basket page i try and pull the total from $aData[sProductsSummary] but this isn't putting the amount in the equation

However, if i use a digit say 100 instead of using $aData[sProductsSummary] the code works.

I'm not sure it would be too lengthy to figure out, it's just for some reason when $aData[sProductsSummary] is put inbetween php tags it doesnt display it's contents

http://www.boatandtackle.co.uk

beholder

Avatar: beholder

2010-09-02 23:59

Do I understand correctly that you want to add the shipping price in BASKET page not in order form page?
next question: do you use product attributes with any of your products?

leeg

Avatar: leeg

2010-09-05 08:59

You sort of understand me, I don't want to add the shipping charge. I simply want to show what it is approximatly based on the amount of the basket total. Not add it to the total, just show

http://www.boatandtackle.co.uk

Back to top
about us | contact