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 |
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? |
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. |
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. |
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}? |
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!!!!!! |
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 |
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. |
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:
{section name=prod_num loop=$products} Not sure if the categoryid is in the cart $products variable as I didn't test it. |
Re: common if/then modifications I make to x-cart...
Quote:
Code:
{if $x eq 'a'}html1{elseif $x eq 'b'}html2{else}html3{/if} |
All times are GMT -8. The time now is 07:40 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.