Wednesday 15 September 2004 1:59:25 pm - 5 replies
Hello!
In my product class the <b>price is not required</b>, so I can create a product without price.
Now I want to show the price in my page only if it is greater than 0.00, <b>I don't want to display 0.00</b>
I did several test but nothing worked fine.
My code in line view
{section show=$node.object.data_map.price.content.is_empty|not}
{attribute_view_gui attribute=$node.object.data_map.price}
{/section}
And I tested these too
{section show=$node.object.data_map.price.content.is_null|not}
{section show=$node.object.data_map.price.content|gt(0)}
{section show={$node.object.data_map.price.content|eq(0)}|not}
But any of these worked fine, the price 0.00 still appear in my page...
<b>How can I do this??</b>
Thanks a lot!
Leandro
Modified on Wednesday 15 September 2004 2:01:24 pm by Leandro Alves
Wednesday 15 September 2004 5:22:01 pm
Hi Alex!
Thanks for the reply... But how can I do this???
I don't know how to test... Is the price a integer????
If I know how to test, may I can use this condition in the <i>show</i> instruction.
The gt() operator tests if one value is greater than other, but it didn't work to me.
Could somebody help me?
Thanks again!
Leandro
Wednesday 15 September 2004 6:42:46 pm
Hrrrrm, I was thinking of the gt operator, sorry to hear it didn't work. You mentioned that it displays '0.00', so I would assume it is an integer. Try comparing against <i>$node.object.data_map.price.data_float</i> instead.
If that doesn't do it, try viewing all of the attributes using <i>|attribute(show)</i>. It may provide some additional information that could lead to an answer.
Wednesday 15 September 2004 8:10:22 pm
Hei Alex!
Thanks a lot for your reply... ![]()
The <i>$node.object.data_map.price.data_float</i> works fine!!!
The code used:
{section show=$node.object.data_map.price.data_float|gt(0)}
{attribute_view_gui attribute=$node.object.data_map.price}
{/section}
Regards
Leandro
You must be logged in to post messages in this topic!