| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
common if/then modifications I make to x-cart... | ||||
|
|
Thread Tools | Search this Thread |
#81
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Hi,
Does anyone know if you can use like with smarty? We want to say {if $products[product].productcode like "C-"}do this{else}dothis{/if} Thanks
__________________
Version 4.1.9 X-Cart Sites:- www.artyfect.com www.naval-military-press.com www.bookguild.co.uk www.humangivens.com |
|||||||
#82
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Quote:
Like? Here are the smarty functions rules: http://www.smarty.net/manual/en/language.function.if.php If you use numerical productID as your var, then you can easily constrain an if to give you the correct results. Why not use the numerical ID? Am I missing what you're trying to do here?
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4 |
|||||||
#83
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
In "like" i mean like in SQL eg - SELECT * from orders where items like '%electronic%'
Basically we mark all products that are variants with a productcode that begins "C-" and i want to show a field based on this. Hope that makes sense.
__________________
Version 4.1.9 X-Cart Sites:- www.artyfect.com www.naval-military-press.com www.bookguild.co.uk www.humangivens.com |
|||||||
#84
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Any idea how to use $cat variables on the Cart page? For example, you can use:
{if $cat eq "X"} SHOW THIS {/if} on other pages, but it doesn't work on the cart page.
__________________
x-cart 4.2.2 |
|||||||
#85
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
What if instead of {if=a}html1{else}html2{/if} you wanted something like this:
{if=a}html1{if=b}html2{else}html3{/if}? |
|||||||
#86
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Quote:
Anyone have a response to this? I have tried {if $products[product].categoryid eq "3"} and {if $products[product].catid eq "3"} and neither work...I am trying to display a specific message in the cart if the customer has a product from that category in their cart. Thanks!!!!!!
__________________
x-cart 4.1.9 |
|||||||
#87
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
I use this on the product.tpl for categories and it works there... give it a try on your cart page:
{if $product.categoryid == 3} Robert
__________________
X-cart 4.1.10 |
|||||||
#88
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Thanks but unfortunately that doesn't work.
If anyone else has a suggestion feel free to pass it along. Thank you.
__________________
x-cart 4.1.9 |
|||||||
#89
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
You have to ensure you are using a variable in a section loop. For example:
Code:
Not sure if the categoryid is in the cart $products variable as I didn't test it. |
|||||||||
#90
|
|||||||||
|
|||||||||
Re: common if/then modifications I make to x-cart...
Quote:
Code:
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|