published/SC/html/scripts/js/frame.js ======================================================== if (keynum == 46) return true;// skip delete + if (keynum == 190) + return true;// skip . if (keynum >= 96 && keynum <= 105) { keynum -= 48; } keychar = String.fromCharCode(keynum); // alert('char '+keychar+'\n code '+keynum); - numcheck = /\d/; + numcheck = /^[\d.]?$/; return numcheck.test(keychar); ======================================================== published/SC/html/scripts/classes/class.shoppingcart.php ======================================================== * @param int $quantity */ function _setItemQuantity(&$Item, $quantity){ $xnQuantity = &$Item->getFirstChildByName('quantity'); - $xnQuantity->setData(intval($quantity)); + $xnQuantity->setData(floatval($quantity)); } ======================================================== published/SC/html/scripts/core_functions/cart_functions.php ======================================================== function cartAddToCart( $productID, $variants, $qty = 1 ){ if($qty === ''){$qty = 1;} - $qty = max(0,intval($qty)); + $qty = max(0,floatval(($qty)); $productID = intval($productID); $product_data = GetProduct($productID); if(!$product_data['ordering_available'])return false; ======================================================== published/SC/html/scripts/core_functions/order_status_functions.php ======================================================== " where orderID=$orderID" ); while( $item = db_fetch_row($q) ) { - $Quantity = intval($item["Quantity"]); + $Quantity = floatval($item["Quantity"]); $q1 = db_query( "select productID from ".SHOPPING_CART_ITEMS_TABLE. " where itemID=".$item["itemID"] ); $product = db_fetch_row( $q1 ); ======================================================== published/SC/html/scripts/modules/cart/scripts/shopping_cart.php ======================================================== foreach ($upd_data as $_itemID=>$_data){ - $cartEntry->setItemQuantity($_itemID, intval($_data['count'])); + $cartEntry->setItemQuantity($_itemID, floatval($_data['count'])); } $cartEntry->saveCurrentCart(); ========================================================
また、テーブルに変更を加えます。
ALTER TABLE `SC_shopping_carts` CHANGE COLUMN `Quantity` `Quantity` DECIMAL(11,000) NULL DEFAULT NULL AFTER `itemID`; ALTER TABLE `SC_ordered_carts` CHANGE COLUMN `Quantity` `Quantity` DECIMAL(11,000) NULL DEFAULT NULL AFTER `Price`;