Forums / Developer / Strange behaviour with ezprice.

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