Jump to content

Setting the postage dependent on total spent - if.. else.. ?


BarneyJoe

Recommended Posts

Hopefully this is an easy syntax one I just can't quite get.

 

Basically have a shopping cart, and need to change it from free postage to free postage if the customer spends £25 or more.

 

At the moment I have a TotalPrice line of :

 

<?php echo WA_eCart_DisplayMoney($WA_eCart1, $WA_eCart1->TotalColumn("TotalPrice")); ?>

 

And a GrandTotal line of :

 

<?php echo WA_eCart_DisplayMoney($WA_eCart1, $WA_eCart1->GrandTotal()); ?>

 

So I think I need to change the GrandTotal line to an if.. else.. statement along the lines of :

 

<?php if 
(WA_eCart_DisplayMoney($WA_eCart1, $WA_eCart1->TotalColumn("TotalPrice"))< 25.00)
echo WA_eCart_DisplayMoney($WA_eCart1, $WA_eCart1->GrandTotal()+2.50); 
else
echo WA_eCart_DisplayMoney($WA_eCart1, $WA_eCart1->GrandTotal());
?>

 

ie if the TotalPrice is less than £25 add £2.50 onto the GrandTotal, otherwise don't.

 

But it's not quite right - any help much appreciated.

 

Cheers.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.