Hi Guys,
I know there must be a way to do it, I would like to have a little shipping calculator on the fly, so I thought I could call weight <?php echo $product_weight ?> multiplied my shipping fee, but I dont know how to call this, any ideas?
Thanks in advance for anything anyone might come up with!
Quote from: LuukDriessen on January 25, 2013, 12:38:32 PM
I did some research.
I found/knew that <?php echo $product->product_weight ?> is used to show the weight of the product.
And did you do some research. Did you check these sticked threads about template overrides in this forum section?
Yup that is where I found how to call the weight from Banquets awesome posts that I always go back to :)
What I want to do on the product page is somehow display weight x shipping dont need it ajax I dont think, basically there are two shipping rates so it would be
weight x shipping
and
weight x shipping + 2% insurance fee
Any ideas?
So are you able to show weight or not?
Hi Maxim,
thanks foe being so patient with me :) yes I can show the weight I just cant show what the shipping would cost!
Quote from: liquid.ideas on August 16, 2013, 13:17:32 PM
... what the shipping would cost!
Thank you!
And how much is the shipping would be?
Hi Maxim,
It would be R70 for the first ten kilograms, and R10 per kilogram thereafter :)
Oh come on, it's fair easy to challenge php IF command for this. Try to construct and test something and I'll help you during your probes.
Hi Maxim,
I can do something like this and works:
$result = $this->product->product_weight;
$rshipping = 70 ;
$count =+ 3.5 ;
if ($result <=2) {echo "Shipping Estimate Regional:<br />" .$rshipping;}
elseif ($result++) {echo "Shipping Estimate Regional: <br />" .$rshipping + $count;}
But that only returns "3.5" if the weight is three, I am not sure how to say for example "if result is +1 then add 3.5 to rshipping, I know it is something that is probably blindingly obvious but cant work it out
Quote from: liquid.ideas on August 17, 2013, 08:59:35 AM
ten kilograms
if ($result <=10) {echo "Shipping Estimate Regional:<br />" .$rshipping;}
else {echo "Shipping Estimate Regional: <br />" . ($rshipping + 10*($result-10)) ; }
Thank you Thank you THANK YOU Maxim!!
Yes, this works like a bomb, for anyone else you may get a syntax error just add in a ; before closing bracket
Thank you for pointing this, Liquid. And ... you are welcome!