Jump to content

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


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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.