Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Feature help: This much until free shipping.

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-30-2010, 01:27 PM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default Feature help: This much until free shipping.

Hi,
My apologies if this mentioned somewhere else in the forum - couldn't find it.

I've got my cart set to give free shipping to orders over $300. What I want is a blurb that says "$xx until you qualify for free shipping". I think I know how to test if the total is less than a certain amount ({if $minicart_total_cost < 300}), but I don't know how to calculate the amount remaining. I assume I need to add it to a function somewhere.

Can someone help?

Thanks.
__________________
--
Version 4.0.17 Gold
Version 4.1 Gold
Version 4.4 Gold
Reply With Quote
  #2  
Old 08-30-2010, 02:00 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Feature help: This much until free shipping.

Try something like this:

Code:
{if $cart.discounted_subtotal gt 300.00} <div style="font-weight: bold; color:#00AEAF;">Congratulations, you qualify for Free Shipping!</div> {else} <div style="font-weight: bold; color:#00AEAF;">Spend an additional {math equation="x - y" x=300.00 y=$cart.discounted_subtotal} to qualify for Free Shipping</div> {/if}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 08-30-2010, 02:28 PM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default Re: Feature help: This much until free shipping.

Thanks for the quick reply. I got the following error:

Spend an additional Warning: Smarty error: math ``x - y'' in ``.../new_offers_short_list.tpl'': parameter ``y'' is empty in .../Smarty-2.6.12/Smarty.class.php on line 1095
to qualify for Free Shipping
__________________
--
Version 4.0.17 Gold
Version 4.1 Gold
Version 4.4 Gold
Reply With Quote
  #4  
Old 08-30-2010, 03:38 PM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default Re: Feature help: This much until free shipping.

I managed to make it work by using $minicart_total_cost. Maybe not ideal, but works.

{if $minicart_total_cost gt 300.00}
<div style="font-weight: bold; color:red;">Congratulations, you qualify for free shipping!</div>
{else}
<div style="font-weight: bold; color:red;">Spend an additional ${math equation="x - y" x=300.00 y=$minicart_total_cost} to qualify for Free Shipping</div>
{/if}
__________________
--
Version 4.0.17 Gold
Version 4.1 Gold
Version 4.4 Gold
Reply With Quote
  #5  
Old 08-31-2010, 05:21 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Feature help: This much until free shipping.

The solution I posted was for 4.0 - 4.1 uses a different smarty variable I believe. Be careful about the minicart total - you want subtotal, not total as if shipping is already added in it will throw off the calculation.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:55 AM.

   

 
X-Cart forums © 2001-2020