[solved] {if} statements and multiple conditions in modules
Posted: Sun Dec 27, 2009 8:50 am
Hi,
I am stuck with a general issue regarding {if} statements in one module.
In the cart module, I want to display different messages depending on how many products are in the cart.
{if no products}
you have no products
{else}{if number of products >10}
sorry, maximum of 10 products for an online order, please call
{else}
display cart
{/if}
{/if}
I have used:
{if !isset($cartitems) || count($cartitems) >10 }
[CONTENT]
{else}
{if !isset($cartitems) || count($cartitems) == 0 }
[CONTENT]
{else}
[CART]
{/if}
{/if}
However, the {if !isset($cartitems) || count($cartitems) >10 } isn't taken into account at all.
The cart works as if that condition wasn't present.
If it is empty, it displays the empty message, but I can add as many items as I want without it displaying the >10 please call message.
Can you help me with the syntax please?
Regards
Ben
I am stuck with a general issue regarding {if} statements in one module.
In the cart module, I want to display different messages depending on how many products are in the cart.
{if no products}
you have no products
{else}{if number of products >10}
sorry, maximum of 10 products for an online order, please call
{else}
display cart
{/if}
{/if}
I have used:
{if !isset($cartitems) || count($cartitems) >10 }
[CONTENT]
{else}
{if !isset($cartitems) || count($cartitems) == 0 }
[CONTENT]
{else}
[CART]
{/if}
{/if}
However, the {if !isset($cartitems) || count($cartitems) >10 } isn't taken into account at all.
The cart works as if that condition wasn't present.
If it is empty, it displays the empty message, but I can add as many items as I want without it displaying the >10 please call message.
Can you help me with the syntax please?
Regards
Ben