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

Making Coupon Field Disappear after valid code is entered

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 08-25-2003, 04:57 PM
 
rodneyw rodneyw is offline
 

Senior Member
  
Join Date: Mar 2003
Posts: 162
 

Default Making Coupon Field Disappear after valid code is entered

I am running 3.4.4 and on the Cart page where the coupon field is located I would like to make it "disappear" after a coupon is entered and Display a message telling them that a coupon has already been applied to this order.

````````````````````

Once again never mind, I got it. I just checked the cart_total.tpl file to see how IT was checking for a coupon.

Here how I changed the call to the coupon in the cart.tpl file if anyone is interested.
Code:
{if $cart.coupon_discount ne 0} A coupon code has already been used on this order {else} {if $active_modules.Discount_Coupons ne ""} {include file="modules/Discount_Coupons/add_coupon.tpl} {/if} {/if}
Reply With Quote
  #2  
Old 08-26-2003, 10:27 AM
  groovico's Avatar 
groovico groovico is offline
 

X-Man
  
Join Date: Apr 2003
Location: Firetanksoftware.com
Posts: 2,326
 

Default

Nice one, I was thinking about this very problem yesterday since we were discussing coupons and gift coupons
__________________
Groovico

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

http://www.firetanksoftware.com

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
  #3  
Old 01-05-2004, 01:49 PM
 
Xixao Xixao is offline
 

Advanced Member
  
Join Date: Dec 2003
Posts: 32
 

Default

This is pretty obvious code, but I thought I'd add it here, cause it makes the addition look a lot cleaner. Replace the code listed above with:

Quote:

{if $cart.coupon_discount ne 0}
<center>A coupon code has already been used on this order</center>
{else}
{if $active_modules.Discount_Coupons ne ""}
{include file="modules/Discount_Coupons/add_coupon.tpl}
{/if}
{/if}



That's it. Just a few extras. Nothing special.
Reply With Quote
  #4  
Old 01-05-2004, 01:56 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 480
 

Default

great mod!
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote
  #5  
Old 01-05-2004, 07:38 PM
  leon's Avatar 
leon leon is offline
 

X-Wizard
  
Join Date: Mar 2003
Location: Costa Rica
Posts: 1,213
 

Default

nfc5382: I agree, and talking about great mods, I saw your site last month but I cant figure out how you added the small bike icons next to your menu items, are they cold coded ?
__________________
It doesn\'t matter what is done... it is how it is done.
=============================
XCart Version: 3.5.3 -> Dmcigars.com
XCart Version: 4.1.3....
Reply With Quote
  #6  
Old 01-06-2004, 03:46 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 480
 

Default

ya those are just hard coded buttons (the LH navigation buttons). Its just what I had before I incorporated xcart into my site. I ended up keeping them and putting xcart around the existing site.
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote
  #7  
Old 01-11-2004, 09:43 AM
 
curpier curpier is offline
 

Advanced Member
  
Join Date: Sep 2003
Posts: 38
 

Default

Looks like a great Mod. Can anyone tell me what code I need to replace with the code above to get this to work. I'm still learning. Thanks much.

Adam
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 08:57 AM.

   

 
X-Cart forums © 2001-2020