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.