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

Using a trigger to display text in txt_cart_header

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-28-2004, 08:01 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default Using a trigger to display text in txt_cart_header

I thought I'd ask the forum this as the X-cart guys seem to be a bit snowed under.

I got them to sort out some free gift code e.g. spend x amount and choose from a selection of gifts, which shows underneath the cart contents of the checkout page if the trigger amount has been reached.

Looking at it now, I would like to be able to have some text pop up in txt_cart_header once that trigger has been reached, saying something like "Congratulations, you've spent enough for a free gift, please select from the items at the bottom of this page". I was thinking something along the lines of getting it to trigger when it sees the free gift label (lbl_free_gift) which in itself is triggered when the amount is reached. How would I instigate this trigger within txt_cart_header -some sort of "if" statement?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #2  
Old 05-28-2004, 08:16 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

Actually, I think I'm on the right track here. I found the free gift template they created and it shows the free gift selection based on this:

Code:
{if $cart.giftproducts ne "" and $products ne "" }.....{/if}

I've just experimented with cart.tpl and inserted this after the txt_cart_header label:

Code:
{if $cart.giftproducts ne "" and $products ne "" }You have spent enough{/if}

This shows up correctly with the gift selection trigger and in probably the right place but I'm thinking that I should create a new label and reference that rather than hard coding static text into cart.tpl. Am I on the right lines?

Thanks

Dan
__________________
4.4.2

and

4.6.1
Reply With Quote
  #3  
Old 05-28-2004, 08:53 AM
 
DanUK DanUK is offline
 

X-Adept
  
Join Date: Dec 2003
Location: UK
Posts: 800
 

Default

OK, I think I've got it now

I created a new label called lbl_free_gift_congrats and used it like so:

Code:
{if $cart.giftproducts ne "" and $products ne "" }{$lng.lbl_free_gift_congrats}{/if}

in cart.tpl. This seems to work for me, anyone see any problems with doing it this way or is there a more efficient way?

Thanks

Dan
__________________
4.4.2

and

4.6.1
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 01:57 PM.

   

 
X-Cart forums © 2001-2020