Re: Conditional Test for Text String
Here is what I tried and it didn't work for some reason:
{if $sales and $sales[sale].name|truncate:5 eq "Buy 3"}
{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}
{elseif $sales}
{else}
{{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}
{/if}
Everything works but the first condition. Using this code the buy now button doesn't display on anything that starts with Buy 3.
Seems to me the string compare isn't working. However, I have looked on the smarty forum and haven't found anything like it yet.
Please help me get this answer.
Thanks,
Randal
__________________
***********************
Visit Our Other Web Sites!
∙ Nutritional Herbs and Supplements
<a href="http://www.theherbsplace.com"> The Herbs Place </a>
∙ Frugal Ideas and a Forum To Submit Your Questions
<a href="http://www.thefrugallife.com"> The Frugal Life </a>
∙ Healthy and Natural Pet Products
<a href="http://www.healthypetcorner.com"> Healthy Pet Corner </a>
***********************
Joined 08/02/05
X-Cart Gold Version 4.3.2
Linux RedHat Enterprise
|