X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   remove discount from totals if no discount used (https://forum.x-cart.com/showthread.php?t=6146)

shan 01-21-2004 06:24 PM

remove discount from totals if no discount used
 
heres a simple mod that removes the discount field from the checkout if there is no discount being given.

all you have to do is open up cart_totals.tpl and replace


Code:

<TR>
<TD nowrap><font class=FormButton>{$lng.lbl_discount}:</font></TD>
<TD>[img]{$ImagesDir}/null.gif[/img]
</TD>
<TD nowrap align=right><font class=ProductPriceSmall>{include file="currency.tpl" value=$cart.discount}</font></TD>
<TD nowrap align=right>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.discount}</TD>
</TR>


with

Code:

{if $cart.discount ne 0 }
<TR>
<TD nowrap><font class=FormButton>{$lng.lbl_discount}:</font></TD>
<TD>[img]{$ImagesDir}/null.gif[/img]
</TD>
<TD nowrap align=right><font class=ProductPriceSmall>{include file="currency.tpl" value=$cart.discount}</font></TD>
<TD nowrap align=right>{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$cart.discount}</TD>
</TR>
{/if}


this was done in 3.5.x but would work pretty much the same in other versions.

this is the only code added
Code:

{if $cart.discount ne 0 }

Old code here

{/if}


leon 01-21-2004 06:49 PM

Thats nice shan, could you give the code to the developers so they can add it to the next release ?

adpboss 01-22-2004 05:12 AM

You will also want to clean up your print and email invoices wherever possible.

I find that the Coupon and Discount fields in the invoices leave the customer feeling like they missed some kind of pricing advantage when they ordered.

Change the Discount and Coupon Display in mail.order_data.tpl to

Code:

{if $order.discount ne "0.00"}{$lng.lbl_discount}:        {include file="currency.tpl" value=$order.discount}{/if}
{if $order.coupon ne ""}{$lng.lbl_coupon_saving}:  {include file="currency.tpl" value=$order.coupon_discount} ({$order.coupon}){/if}


I do the same with my taxes (Canada) because we have 2 and it only serves to confuse US and UK customers (to which they do not apply). 1 less Customer Service email to answer is one less headache.

ylenyon 01-23-2004 06:33 AM

thanks
 
Thanks for the mod. Just a reminder for everyone to also change the template in the mail/html section if you are using html mail notifications. Same code, just placed around the html table tags.

GM 05-29-2004 10:46 PM

I think Shan & adpboss (among others) should be on the design team for XCART :wink:
Have you ever noticed that they work good together? Adpboss is also good at destroying speedbars! Don't even mention the word speedbar around him... missles come out of his shoulders and he destroys them! 8O This post deserved to be bumbed to the top again, it should be standard cart issue, nice work guys! :lol:

24md 09-15-2004 06:51 AM

Lovely little mod to help tidy up xcart and make it look a bit neater. Thanks a million.


All times are GMT -8. The time now is 07:43 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.