Strange behaviour with ezprice.

Author Message

Adolfo Barragán

Thursday 18 September 2003 1:16:30 am

I have a product class with price excluding VAT (16%). When I *edit* the product, I typed price without VAT (i.e: 100), but when I *view* the product it show me the price including VAT (i.e: 116).

I look at standard/templates/content/datatype/view/exprice.tpl and use "inc_vat_price" hardcoded.

It's possible add logic to this template to show "inc_vat_price" or "ex_vat_price" according to setup for product class?

Thanks,
Adolfo Barragan

Paul Forsyth

Thursday 18 September 2003 1:36:11 am

Yes, you would override the ezprice.tpl in your own design. Read up on overriding standard templates:

http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

With the override in place you can whatever code you want to display your information.

You should consider that this will apply to *every* ezprice you use though. It may be better to to not use {attribute_view_gui} in some instances and instead just access the variable and display the parts you want manually.

Hope this helps!

Paul

Adolfo Barragán

Thursday 18 September 2003 1:51:25 am

Yes, I change manually ezprice.tpl and then show "ex_vat_price".

But if I change product class and I set "price include vat" then I need change ezprice.tpl again.

How can I determine in ezprice.tpl if product class include or exlude VAT?

Again, thanks for your help
Adolfo Barragan

Paul Forsyth

Thursday 18 September 2003 2:04:35 am

Ok, so you need to look at the class itself to see if that option is set.

Have a look at this file. It has the code you need:

design/standard/templates/class/datatype/edit/ezprice.tpl

Do you use the 'grep' command? It is very useful in finding where code is located. I've picked up most of my knowledge about the ez system using it to see how ez do it :)

Paul

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:10:08
Script start
Timing: Jan 18 2025 22:10:08
Module start 'layout'
Timing: Jan 18 2025 22:10:08
Module start 'content'
Timing: Jan 18 2025 22:10:10
Module end 'content'
Timing: Jan 18 2025 22:10:10
Script end

Main resources:

Total runtime1.3130 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 587.9141152.6250
Module start 'layout' 0.00600.0041 740.539139.4453
Module start 'content' 0.01011.3015 779.9844478.6094
Module end 'content' 1.31160.0014 1,258.593812.1641
Script end 1.3130  1,270.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2676160.0002
Check MTime0.00140.1048160.0001
Mysql Total
Database connection0.00110.083410.0011
Mysqli_queries1.258995.8785600.0210
Looping result0.00060.0470580.0000
Template Total1.278697.420.6393
Template load0.00220.168620.0011
Template processing1.276497.206720.6382
Template load and register function0.00020.016210.0002
states
state_id_array0.00090.066310.0009
state_identifier_array0.00180.139920.0009
Override
Cache load0.00190.1424270.0001
Sytem overhead
Fetch class attribute can translate value0.00100.073620.0005
Fetch class attribute name0.00170.127840.0004
XML
Image XML parsing0.00020.016820.0001
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00090.0665100.0001
String conversion0.00000.000940.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs