Hope this will be fixed on the core code of Opencart. I noticed most of the carts powered by Opencart out there they didn't have validation for quantity, and may cause a serious problem for some if they overlooked it.
I made a workaround for this. This logic will always round up the quantity if it is in fractions. Let me know if there are problems after applying the fix or if there are other instances i need to apply this logic. Well this workaround will only apply to cart that sells units that are non-fractions. Thanks Bruce.
open
yourstore/library/cart.php
on ~line26:
find this:
replace with:
thanks
I made a workaround for this. This logic will always round up the quantity if it is in fractions. Let me know if there are problems after applying the fix or if there are other instances i need to apply this logic. Well this workaround will only apply to cart that sells units that are non-fractions. Thanks Bruce.
open
yourstore/library/cart.php
on ~line26:
find this:
Code: Select all
$quantity = $value;
Code: Select all
$quantity = abs(ceil($value));
thanks
Last edited by marvin on Fri Apr 04, 2008 9:23 am, edited 1 time in total.
It's not really a bug.
Imagine for a moment, the situation where the item the shop owner is selling has a unit of sale such as weight. These quantites may not be whole units. Food products are an obvious example of this.
Even so, it might be nice to be able to specify some simple product quantity validation for each product using the product administration pages.
eg:
Imagine for a moment, the situation where the item the shop owner is selling has a unit of sale such as weight. These quantites may not be whole units. Food products are an obvious example of this.
Even so, it might be nice to be able to specify some simple product quantity validation for each product using the product administration pages.
eg:
- a minimum order quantity (to avoid zero and negatives)
- whole or fractional numbers
Who is online
Users browsing this forum: No registered users and 3 guests