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)
-   -   'Discount Coupon taken' tpl mod (https://forum.x-cart.com/showthread.php?t=17708)

jb5ep 11-02-2005 11:36 AM

'Discount Coupon taken' tpl mod
 
A client was complaining about the fact that it's not immediately obvious what's happened if you submit a coupon in the XC checkout process. So...here's a small template mod to make things a bit more 'tactile' when taking coupons. Shots below highlight what happens with this mod:

Usual stuff - back up before modifying anything, etc

Before entering coupon
(note: our coupon.tpl has been moved to the top)
http://www.ocpx.com/temp/coupon_before.gif

After entering coupon
(note: there's an assumption here that you can only enter one coupon in the XC checkout - certainly the case with our install of 4.016, but if anyone knows any diffently, please shout)
http://www.ocpx.com/temp/coupon_after.gif


Tpl changes required to implement this:
1. Goto skin1/modules/Discount_Coupons/add_coupon.tpl
2. Create an {if} statement to wrap around your 'this coupon's been taken' content.. - create your lang vars if you're not as lazy as me.
3. At the end of your 'coupon taken element, add an {else}, followed by your 'default' add_coupon.tpl
4. Close the {/if}.

For example:
Code:

{if $cart.coupon_discount ne 0 and $cart.coupon_type ne "free_ship"}
...
...
Your coupon has been taken and {include file="currency.tpl" value=$cart.coupon_discount} has been deducted below.
..
..
{else}
{capture name=dialog}
<TABLE width="706">
  <TR>
    <TD colspan="4"><LI>{$lng.lbl_bullet_coupon}</LI></TD>
  </TR>
  <TR>
    <TD colspan="3">  </TD>
  </TR>
  <FORM action="cart.php" name="couponform">
    <TR>
      <TD width="152">{$lng.lbl_coupon_code}:</TD>
      <TD width="542">
        <INPUT type="text" size="32" name="coupon" class="inputfield">
       
               
      </TD>
    </TR>
    <TR>
      <TD width="152"></TD>
      <TD width="542">
        <input type="submit" class="secondarybutton" value="{$lng.lbl_use_this_coupon}">
      </TD>
    </TR>
    <INPUT type="hidden" name="mode" value="add_coupon">
  </FORM>
</TABLE>
{/capture}
{ include file="dialog_COUPON.tpl" title=$lng.lbl_discount_coupon content=$smarty.capture.dialog extra="width=100%" }



Hope that's useful.

Cheers,

balinor 11-02-2005 11:40 AM

Hey nice one! I get the occasional client complaining about this too, this should quiet them down :)

BoomBoomBap 11-16-2005 02:50 PM

Thanks! This worked well :)

Dongan 11-16-2005 07:23 PM

will be bit useful. Thanx for sharing...


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

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