• Welcome to KonaKart Community Forum. Please login or sign up.
 

Decimal Support for quantity

Started by hasalem, January 25, 2008, 03:46:38 pm

Previous topic - Next topic

hasalem

Dear All,

I wonder If KonaKart supports decimal for quantity.

or is there  a workaround to help in implementing a Grocery eCommerce Application, Where the List Price is for 1 KG, but the customer can buy a portion of the Kilogram.

Many thanks for your in advance co operation
Best Regards
Hatem Salem

trevor

Hi,

You could have a bread product (for 1Kg) and then have options with negative prices to allow people to buy less. i.e. You could have 3 options:

  • 0.25kg

  • 0.5kg

  • 0.75kg



However, how you manage your quantity in stock will require a bit of thought.

-Trevor

hasalem

Hi Trevor,

Thanks for your quick reply.

My problem comes for certain products, i.e Meat. where the customer wants to order 100 gram, or 125 gram. and the price is per KG.

I used the following, i.e. for Meat with price 10 $ per Kilo.

1- Set the price to 0
2- set option  for 1 KG to be +10$
3- set option for 1 gram to be .01 $

Side effects:
1- STock management
2- The default price of the product is 0, so the user can't know the price till choose the option
3- the pricing is not user friendly and intuitive, because it is per gram for Meat :)
4- Specials can't be applied for this workaround

I wonder, if the operations in the options definition which is plus or minus only (+,-). Can I change to accept Multiply and devision (*,/)

I think this could be a suitable workaround.

like the previous work around
1- Set the price to 10$
2- set option  for 1 KG to be *1
3- set option for 1 gram to be *.001   or /1000

Side effects:
1- STock management (Still there)
2- The default price of the product is 0, so the user can't know the price till choose the option (Solved)
3- the pricing is not user friendly and intuitive, because it is per gram for Meat :)  (Solved)
4- Specials can't be applied for this workaround (Solved)


I will be thankful if you would help me to decide the last workaround could be applied or not ?

Best Regards
Hatem Salem

trevor

Hi,

Maybe you can achieve a solution as follows. Note that I haven't tried it out so there could be errors in the logic.


  • Your product price is always per Kg so this is nice and user friendly

  • Your stock level is in grams

  • When people order you let them specify a quantity in grams.

  • When a product is added to the basket you edit the basket item that gets created by the engine to divide the price by 1000 so that you show the customer the real price.



Since the stock level is in grams and the quantity is in grams, the stock calculations should work correctly.

-Trevor

hasalem

Hi Trevor,

First of All, I'd like to thank you very much for your help and support.
Second, thanks for your suggestion.

Also, I'd like to brain storm another path I've played with it

1- I changed the Java script function isNumber in EditCartBody.jsp to accept Floats,  so it now accepts decimal point
2- I found the CartItem.java bean has only quantity in Integer

Is there a way to modify this bean , and I think the Database also, and the persistence layer.

Also, I suggest to have an attribute for each product to accept decimal point in quantity or not.
is it possible to have this feature, in the future release, or is there a way for me to make this customization by myself? because I can't find the source code of the persistence layers and the VO like CartItem.java


Best Regards
Hatem Salem

hasalem

Hi Trevor,
regarding this solution, how will I differentiate between teh products that need to divided by 1000, and the others that will be bought by one without any conversion?
Quote from: trevor on January 26, 2008, 11:24:21 am
Hi,

Maybe you can achieve a solution as follows. Note that I haven't tried it out so there could be errors in the logic.


  • Your product price is always per Kg so this is nice and user friendly

  • Your stock level is in grams

  • When people order you let them specify a quantity in grams.

  • When a product is added to the basket you edit the basket item that gets created by the engine to divide the price by 1000 so that you show the customer the real price.



Since the stock level is in grams and the quantity is in grams, the stock calculations should work correctly.

-Trevor



Best Regards
Hatem Salem

trevor

Hi,

You could use a custom product field for this.

trevor

Quote
Also, I'd like to brain storm another path I've played with it

1- I changed the Java script function isNumber in EditCartBody.jsp to accept Floats,  so it now accepts decimal point
2- I found the CartItem.java bean has only quantity in Integer

Is there a way to modify this bean , and I think the Database also, and the persistence layer.

Also, I suggest to have an attribute for each product to accept decimal point in quantity or not.
is it possible to have this feature, in the future release, or is there a way for me to make this customization by myself? because I can't find the source code of the persistence layers and the VO like CartItem.java


You could manage quantity yourself using one of the custom fields but at a first glance I think that it could be quite a tricky customization. We'll add your request to our TODO list.

-Trevor