![]() |
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 |
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 |
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 |
All times are GMT -8. The time now is 09:25 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.