Set up a shop with only integer prices

Author Message

Adi Rotea

Friday 01 August 2003 8:20:41 am

I need to set up a shop with only integer prices.

My first thought was to use the currency formatting. The first problem was that my price_inc_vat needs to be rounded to become an integer and the currency format only skipped my decimals. Then the shopping basket calculations uses the float prices so my problem is not the way i display the price according with the currency format but the price datatype itself...

So i've created a new datatype called "ezintprice".
OK...
The probleam seemed solved...

WRONG!!!!

When I've added the discount rules my basket looked ok but the order confirmation contained the float calculated price...
So i've looked throught sources an I've seen that are many scripts that i have to alter... (and i don't want that because seems wrong)....

PLEASE ... someoane HELP ME because now it is so much chaos around me and i don't even know where to start anymore....

So my question is:

What should I do to have a shop with only integer prices .....where should i start to make all the things correctly...should i create a new datatype?.. should I extend the shop functionality? If so how?.

Any help would be very appreciated.

Thanx

Esben Maaløe

Saturday 02 August 2003 4:20:05 am

So what do you want to do ?

If a basket amounts to 25 MONEY and you want to give a 10% (2.50 MONEY) discount what should the price end up like ? 22 MONEY or 23 MONEY ?

Is it possible to setup a FloorThePrice discount rule ? So that your basket may look like this:

Item1 10.00 MONEY
Item2 7.00 MONEY
Item1 8.00 MONEY
==============
Total 25.00 MONEY
Discount -2.50 MONEY
FloorThePrice -0.50 MONEY
====================
Price 22.00 MONEY

???

Adi Rotea

Tuesday 12 August 2003 6:25:50 am

First of all I'm sorry for the delay....

To be more exact I want a shop where all the prices and calculations (price with or without VAT, discounts etc) to be integer numbers...

In my case i have a 19% VAT and my input prices are excluding VAT (meaning that I input the integer price without VAT) and I expect the system to generate the price inclunding VAT as an integer number (or the other way to input the integer price with VAT ant to let the system to generate the price without VAT which i think is a better approach as the price includig VAT is used for the total calculations and the price without VAT is, in my case, only informational)...

Also when I apply a dicount rule i want the discounted price to be an integer number as well...

And the integer number (price) to be the round( double calculated price )

How can i do that using only templates or with minimum of code involved ?

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 18:25:54
Script start
Timing: Jan 18 2025 18:25:54
Module start 'layout'
Timing: Jan 18 2025 18:25:54
Module start 'content'
Timing: Jan 18 2025 18:25:55
Module end 'content'
Timing: Jan 18 2025 18:25:55
Script end

Main resources:

Total runtime0.5870 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.0313152.6406
Module start 'layout' 0.00600.0026 740.671939.4609
Module start 'content' 0.00860.5769 780.1328473.3984
Module end 'content' 0.58550.0014 1,253.531312.1563
Script end 0.5869  1,265.6875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5938160.0002
Check MTime0.00130.2240160.0001
Mysql Total
Database connection0.00120.200410.0012
Mysqli_queries0.532490.7075570.0093
Looping result0.00060.1065550.0000
Template Total0.556094.720.2780
Template load0.00240.416520.0012
Template processing0.553594.306220.2768
Template load and register function0.00030.046510.0003
states
state_id_array0.00090.158310.0009
state_identifier_array0.00150.252220.0007
Override
Cache load0.00200.3376370.0001
Sytem overhead
Fetch class attribute can translate value0.00370.638220.0019
Fetch class attribute name0.00190.328530.0006
XML
Image XML parsing0.00020.035620.0001
class_abstraction
Instantiating content class attribute0.00000.001430.0000
General
dbfile0.00180.3118100.0002
String conversion0.00000.001440.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
3content/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
3content/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