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

'Discount Coupon taken' tpl mod

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 11-02-2005, 11:36 AM
 
jb5ep jb5ep is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: U.K.
Posts: 65
 

Default '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,
__________________
X-Cart 4.0.17
ezUpsell
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Linux
Reply With Quote
  #2  
Old 11-02-2005, 11:40 AM
 
balinor balinor is offline
 

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

Default

Hey nice one! I get the occasional client complaining about this too, this should quiet them down
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 11-16-2005, 02:50 PM
  BoomBoomBap's Avatar 
BoomBoomBap BoomBoomBap is offline
 

Senior Member
  
Join Date: Nov 2002
Location: San Francisco
Posts: 184
 

Default

Thanks! This worked well
__________________
Site 1 > XCART LIVE 3.4.12

Site 2 > XCART LIVE 4.0.17
Reply With Quote
  #4  
Old 11-16-2005, 07:23 PM
  Dongan's Avatar 
Dongan Dongan is offline
 

X-Wizard
  
Join Date: Jul 2005
Location: www.mercuryminds.com
Posts: 1,531
 

Default

will be bit useful. Thanx for sharing...
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:56 AM.

   

 
X-Cart forums © 2001-2020