{if} {else} statement tweaking
I am using a {if} {else} statement to show or hide a Free Shipping graphic on certain items on our shop.
Code:
{if $product.price >= 99.99 && $product.productid ne 20786 && $product.productid ne 17302} Also, maybe this can be used as a reference for someone else looking to do this ;) |
Re: {if} {else} statement tweaking
Quote:
You may want to check this condition in PHP code (in_array() function will be useful) and then assign result to a boolean flag in $product array. It will allow you to check the same condition as something like this in Smarty: HTML Code:
{if $product.my_free_shipping_flag eq 'Y'} Guess, it looks more elegant. |
Re: {if} {else} statement tweaking
Thanks for the response. That actually makes me think... maybe we can use the "extra fields" functionality to do something like this? I don't really know how to implement your suggestion without more explicit instructions.
|
All times are GMT -8. The time now is 06:28 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.