AbanteCart Community
Shopping Cart Operations => Support => Topic started by: maniz on December 22, 2013, 12:28:23 AM
-
I need to use by a meter in the item but at the check point it calculate only the first number not the decimal
e.g.
sell by 1.5 meter x $20.00 = $30.00
check out 1 x $20.00 =$20.00
-
Quantity filed is considered to be whole number, or an integer number and cannot be decimal.
If you need to allow this as a special case for your business model, modification is required.
Open file: core/lib/cart.php
Locate about line 305:
if ((int)$qty && ((int)$qty > 0)) {
if (!isset($this->session->data['cart'][$key])) {
$this->session->data['cart'][$key]['qty'] = (int)$qty;
} else {
$this->session->data['cart'][$key]['qty'] += (int)$qty;
}
//TODO Add validation for correct options for the product and add error return or more stable behaviour
$this->session->data['cart'][$key]['options'] = $options;
}
change to
if ((int)$qty && ((int)$qty > 0)) {
if (!isset($this->session->data['cart'][$key])) {
$this->session->data['cart'][$key]['qty'] = $qty;
} else {
$this->session->data['cart'][$key]['qty'] += $qty;
}
//TODO Add validation for correct options for the product and add error return or more stable behaviour
$this->session->data['cart'][$key]['options'] = $options;
}
-
Thank you abantecart
for your quick and correct respond
I donate 5 euro for your help
-
Glad, I can help. Thank you for donation 8)
-
Quantity filed is considered to be whole number, or an integer number and cannot be decimal.
If you need to allow this as a special case for your business model, modification is required.
Open file: core/lib/cart.php
Locate about line 305:
if ((int)$qty && ((int)$qty > 0)) {
if (!isset($this->session->data['cart'][$key])) {
$this->session->data['cart'][$key]['qty'] = (int)$qty;
} else {
$this->session->data['cart'][$key]['qty'] += (int)$qty;
}
//TODO Add validation for correct options for the product and add error return or more stable behaviour
$this->session->data['cart'][$key]['options'] = $options;
}
change to
if ((int)$qty && ((int)$qty > 0)) {
if (!isset($this->session->data['cart'][$key])) {
$this->session->data['cart'][$key]['qty'] = $qty;
} else {
$this->session->data['cart'][$key]['qty'] += $qty;
}
//TODO Add validation for correct options for the product and add error return or more stable behaviour
$this->session->data['cart'][$key]['options'] = $options;
}
I tried this but its not working. is that not active any more on last version (1.2.15) ???
-
hello Community!
I checked that file core>lib>cart.php and found it as in the solution.
Can you help in this issue to make cart adding decimals and calculating them please?
I really need this function to be processed on orders correctly.
Thank you