Change the database quantity related fields type to DECIMAL (17,2) ************************************************************************ ps_product: quantity, minimal_quantity,out_of_stock ps_order_return_detail: product_quantity ps_pack: quantity ps_product_attribute: quantity, minimal_quantity ps_product_sale: quantity ps_stock: physical_quantity, usable_quantity ps_cart_rule: quantity, quantity_per_user ps_customization: quantity, quantity_refunded, quantity_returned ps_order_detail: product_quantity, product_quantity_in_stock, product_quantity_refunded, product_quantity_return,product_quantity_reinjected ps_specific_price_rule: from_quantity ps_order_slip_detail: product_quantity ps_supply_order_detail: quantity_recieved, quantity_expected ps_stock_available: quantity ps_cart_product: quantity ps_stock_mvt: physical_quantity ps_cart_rule_product_rule_group: quantity ps_product_shop: minimal_quantity ps_supply_order_receipt_history: quantity ps_product_attribute_shop: minimal_quantity ************************************************************************ classes\Cart.php classes\order\OrderDetail.php classes\controller\FrontController.php modules\blockcart\blockcart.php themes\default-bootstrap\product.tpl themes\default-bootstrap\order-detail.tpl themes\default-bootstrap\js\product.js themes\default-bootstrap\js\cart-summary.js themes\default-bootstrap\modules\blockcart\blockcart-json.tpl themes\default-bootstrap\modules\blockcart\blockcart.tpl admin\themes\default\template\controllers\orders\_product_line.tpl ************************************************************************ classes\Cart.php 617 $row['stock_quantity'] = (float)$row['quantity']; 619 $row['quantity'] = (float)$row['cart_quantity']; 701 $row['total'] = $row['price_with_reduction_without_tax'] * (float)$row['cart_quantity']; 702 $row['total_wt'] = $row['price_with_reduction'] * (float)$row['cart_quantity']; 705 $row['total'] = Tools::ps_round($row['price_with_reduction_without_tax'] * (float)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_); 706 $row['total_wt'] = Tools::ps_round($row['price_with_reduction'] * (float)$row['cart_quantity'], _PS_PRICE_COMPUTE_PRECISION_); 711 $row['total'] = Tools::ps_round($row['price_with_reduction_without_tax'], _PS_PRICE_COMPUTE_PRECISION_) * (float)$row['cart_quantity']; 712 $row['total_wt'] = Tools::ps_round($row['price_with_reduction'], _PS_PRICE_COMPUTE_PRECISION_) * (float)$row['cart_quantity']; 820 self::$_nbProducts[$id] = (float)Db::getInstance()->getValue(' 928 $quantity = (float)$quantity; 942 $minimal_quantity = (float)Attribute::getAttributeMinimalQty($id_product_attribute); 944 $minimal_quantity = (float)$product->minimal_quantity; 971 if ((float)$quantity <= 0) { 988 $product_qty = (float)$result2['quantity']; *993 $new_qty = (float)$result['quantity'] + (float)$quantity; *994 $qty = '+ '.(float)$quantity; 996 if (!Product::isAvailableWhenOutOfStock((float)$result2['out_of_stock'])) { 1002 $qty = '- '.(float)$quantity; 1003 $new_qty = (float)$result['quantity'] - (float)$quantity; 1041 if (!Product::isAvailableWhenOutOfStock((float)$result2['out_of_stock'])) { 1042 if ((float)$quantity > $result2['quantity']) { 1047 if ((float)$quantity < $minimal_quantity) { 1057 'quantity' => (float)$quantity, 1078 return $this->_updateCustomizationQuantity((float)$quantity, (int)$id_customization, (int)$id_product, (int)$id_product_attribute, (int)$id_address_delivery, $operator); 1096 SET `quantity` = '.(float)$quantity.', 1106 if (!empty($id_customization) && (float)$quantity < 1) { 1114 if ($operator == 'down' && (float)$result['quantity'] - (float)$quantity < 1) { 1121 `quantity` = `quantity` '.($operator == 'up' ? '+ ' : '- ').(float)$quantity.', 1181 VALUES ('.(int)$this->id.', '.(int)$id_product.', '.(int)$id_product_attribute.', '.(float)$quantity.')' 1261 $product_total_quantity = (float)Db::getInstance()->getValue( 1268 $customization_quantity = (float)Db::getInstance()->getValue(' 1298 if (Db::getInstance()->NumRows() && (float)$result['quantity']) { 1301 SET `quantity` = '.(float)$result['quantity'].' 1363 SET `quantity` = `quantity` - '.(float)$customization['quantity'].' 1572 $products_total[$id_tax_rules_group.'_'.$id_address] += $price * (float)$product['cart_quantity']; 1583 $products_total[$id_tax_rules_group] += Tools::ps_round($product_price, $compute_precision) * (float)$product['cart_quantity']; 3579 VALUES('.(int)$cart->id.', '.(int)$val['id_product_attribute'].', '.(int)$val['id_product'].', '.(int)$id_address_delivery.', '.(float)$val['quantity'].', 0, 0, 1)' 3630 (float)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),'; 3686 `quantity` = `quantity` + '.(float)$result.' 3736 '.(float)$quantity.', 3754 SET `quantity` = `quantity` - '.(float)$quantity.' 3783 '.(float)$quantity.', 4007 if (((float)$product['quantity_available'] - (float)$product['cart_quantity']) < 0 4012 if ((float)$product['quantity_available'] <= 0 4016 if ((float)$product['quantity_available'] > 0 ************************************************************************ classes\controller\FrontController.php 452 'cart_qties' => (float)$cart->nbProducts(), ************************************************************************ modules\blockcart\blockcart.php 65 $nbTotalProducts += (float)$product['cart_quantity']; 145 'nb_total_products' => (float)($nbTotalProducts), ************************************************************************ themes\default-bootstrap\order-detail.tpl 208 213 269 274 307 312 ************************************************************************ themes\default-bootstrap\modules\blockcart\blockcart.tpl 239 {l s='There are [1]%d[/1] items in your cart.' mod='blockcart' sprintf=[$cart_qties] tags=['']} ************************************************************************ themes\default-bootstrap\modules\blockcart\blockcart-json.tpl 34 "quantity": {$product.cart_quantity|floatval}, ************************************************************************ themes\default-bootstrap\js\cart-summary.js nbrProducts += parseFloat(product_list[i].quantity); ************************************************************************ Back Office classes\order\OrderDetail.php 175 'product_quantity' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true), 176 'product_quantity_in_stock' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 177 'product_quantity_return' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 178 'product_quantity_refunded' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 179 'product_quantity_reinjected' =>array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 198 'discount_quantity_applied' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 622 $this->product_quantity = (float)$product['cart_quantity']; 630 $product_quantity = (float)Product::getQuantity($this->product_id, $this->product_attribute_id); 631 $this->product_quantity_in_stock = ($product_quantity - (float)$product['cart_quantity'] < 0) ? 632 $product_quantity : (float)$product['cart_quantity']; ************************************************************************ Back Office admin\themes\default\template\controllers\orders\_product_line.tpl 79 {$product['product_quantity']} ************************************************************************ ************************************************************************ Edit product.tpl and product.js Depend on What You Want ************************************************************************ ************************************************************************ key up and down (+,-) themes\default-bootstrap\product.tpl {if !$PS_CATALOG_MODE} {assign cat16 [['id_category' => 16]]} {assign cat17 [['id_category' => 17]]} {if Product::idIsOnCategoryId($smarty.get.id_product, $cat16)}

quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>

{elseif Product::idIsOnCategoryId($smarty.get.id_product, $cat17)}

quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>

{else}

quantity <= 0) || !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>

{/if} {/if} ************************************************************************ key up and down (+,-) themes\default-bootstrap\js\product.js // The button to increment the product value $(document).on('click', '.product_quantity_up_1', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 1).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_1', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 1) $('input[name='+fieldName+']').val(currentVal - 1).trigger('keyup'); else $('input[name='+fieldName+']').val(1); $('#quantity_wanted').change(); }); // The button to increment the product value $(document).on('click', '.product_quantity_up_2', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 2).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_2', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseInt($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 2) $('input[name='+fieldName+']').val(currentVal - 2).trigger('keyup'); else $('input[name='+fieldName+']').val(2); $('#quantity_wanted').change(); }); // The button to increment the product value $(document).on('click', '.product_quantity_up_3', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseFloat($('input[name='+fieldName+']').val()); if (!allowBuyWhenOutOfStock && quantityAvailable > 0) quantityAvailableT = quantityAvailable; else quantityAvailableT = 100000000; if (!isNaN(currentVal) && currentVal < quantityAvailableT) $('input[name='+fieldName+']').val(currentVal + 0.5).trigger('keyup'); else $('input[name='+fieldName+']').val(quantityAvailableT); $('#quantity_wanted').change(); }); // The button to decrement the product value $(document).on('click', '.product_quantity_down_3', function(e){ e.preventDefault(); fieldName = $(this).data('field-qty'); var currentVal = parseFloat($('input[name='+fieldName+']').val()); if (!isNaN(currentVal) && currentVal > 1 && currentVal > 0.5) $('input[name='+fieldName+']').val(currentVal - 0.5).trigger('keyup'); else $('input[name='+fieldName+']').val(0.5); $('#quantity_wanted').change(); });