Webshop - Rounding rules

Author Message

Lars Eirik R

Friday 14 January 2011 4:29:19 am

Hi.

I am working on a multi currency website where different currencies (different countries) require individual treatment.

Is there a way to indicate that one of the siteaccesses should automatically present its products without decimals?

my fear is that i can do this manually in templates to present to the user, but the values will be stored internally as floats , basically meanin that the sums will not add up when handled internally by the ez kernel.

Note that i do not use autoconversion as this does not meet the clients demand..(therefore shop.ini is a no go)

I am running version 4.1.3 but upgrades will be possible if this should alleviate a potential problem.

Lars Eirik R

Friday 14 January 2011 5:13:40 am

Perhaps it would be smart for me to create my own baskethandler and set this up to read from settings, thereby performing rounding or ceiling of the values.

Any one have any ideas if this is a bad or smart move?

Update:

After having dicussed this with a co worker i think i will store all values with decimals and make sure that the actual value sendt to the payment gateway is rounded up.

This bascially would mean that changing the template output to the user would do what i want it to.

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 02:07:36
Script start
Timing: Jan 18 2025 02:07:36
Module start 'layout'
Timing: Jan 18 2025 02:07:36
Module start 'content'
Timing: Jan 18 2025 02:07:37
Module end 'content'
Timing: Jan 18 2025 02:07:37
Script end

Main resources:

Total runtime1.0582 sec
Peak memory usage4,096.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 587.9063152.6250
Module start 'layout' 0.00710.0025 740.531339.4375
Module start 'content' 0.00961.0469 779.9688457.6484
Module end 'content' 1.05650.0017 1,237.61728.1797
Script end 1.0582  1,245.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3103160.0002
Check MTime0.00140.1299160.0001
Mysql Total
Database connection0.00120.112610.0012
Mysqli_queries1.011195.5425520.0194
Looping result0.00050.0484500.0000
Template Total1.028697.220.5143
Template load0.00220.207920.0011
Template processing1.026496.990320.5132
Template load and register function0.00010.011210.0001
states
state_id_array0.00080.077010.0008
state_identifier_array0.00090.086420.0005
Override
Cache load0.00180.1686170.0001
Sytem overhead
Fetch class attribute can translate value0.00110.104010.0011
Fetch class attribute name0.00150.137130.0005
XML
Image XML parsing0.00050.049110.0005
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00080.0747160.0000
String conversion0.00000.000540.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs