Forums / Setup & design / Product Price Empty

Product Price Empty

Author Message

Leandro Alves

Wednesday 15 September 2004 4:59:25 am

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

Alex Jones

Wednesday 15 September 2004 6:31:38 am

Perhaps you could try testing the price to see if it is greater than 0..?

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Leandro Alves

Wednesday 15 September 2004 8:22:01 am

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

Alex Jones

Wednesday 15 September 2004 9:42:46 am

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.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Leandro Alves

Wednesday 15 September 2004 11:10:22 am

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

Alex Jones

Thursday 16 September 2004 6:08:51 am

That is great to hear Leandro! I am glad I could help.

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

eZ debug

Timing: Jan 18 2025 11:42:16
Script start
Timing: Jan 18 2025 11:42:16
Module start 'content'
Timing: Jan 18 2025 11:42:16
Module end 'content'
Timing: Jan 18 2025 11:42:17
Script end

Main resources:

Total runtime0.8057 sec
Peak memory usage4,096.0000 KB
Database Queries203

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 587.6875180.8438
Module start 'content' 0.00540.6288 768.5313573.8984
Module end 'content' 0.63420.1714 1,342.4297337.3984
Script end 0.8056  1,679.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4983210.0002
Check MTime0.00180.2211210.0001
Mysql Total
Database connection0.00050.058810.0005
Mysqli_queries0.727790.32352030.0036
Looping result0.00190.24202010.0000
Template Total0.777296.520.3886
Template load0.00200.247520.0010
Template processing0.775296.211320.3876
Template load and register function0.00020.026410.0002
states
state_id_array0.00070.088610.0007
state_identifier_array0.00120.147120.0006
Override
Cache load0.00160.1996420.0000
Sytem overhead
Fetch class attribute can translate value0.00190.231930.0006
Fetch class attribute name0.00090.114470.0001
XML
Image XML parsing0.00080.104830.0003
class_abstraction
Instantiating content class attribute0.00000.001890.0000
General
dbfile0.00190.2340270.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 30
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs