When your magento implement in a country with small number digits currency like US or Major Europe countries this issue maybe will not happens, but if your Magento implement in some countries with currency with a lot number of digits like dollar zimbabwe or indonesia rupiah or dong vietnam (conversion from USD).. it will be a problem, i found a way to fix this problem:
- Edit file app\code\core\Mage\Sales\Helper\Data.php
- increase number “const MAXIMUM_AVAILABLE_NUMBER” to whatever you want, mine change to 99999999999 (almost 1 trillion)
- go to your database use Phpmyadmin or adminer or you fav mysql tool
- run this query to find all magento tables columns with data type “Decimal”
-
select TABLE_NAME, COLUMN_NAME,COLUMN_TYPE,COLUMN_KEY from information_schema.columns where table_schema = ‘YOUR_DB_NAME’ and data_type= 'decimal' order by COLUMN_KEY DESC,table_name,ordinal_position
- the sql result will be like this
-
TABLE_NAME COLUMN_NAME COLUMN_TYPE cataloginventory_stock_item qty decimal(12,4) cataloginventory_stock_item min_qty decimal(12,4) cataloginventory_stock_item min_sale_qty decimal(12,4) cataloginventory_stock_item max_sale_qty decimal(12,4) cataloginventory_stock_item notify_stock_qty decimal(12,4) cataloginventory_stock_item qty_increments decimal(12,4) cataloginventory_stock_status qty decimal(12,4)
- save the query result to excel/csv
- open use excel
- generate sql script use concatenate excel function
- mine use this excel function
-
=CONCATENATE("ALTER TABLE ",A2," CHANGE ",B2," ",B2," DECIMAL(19,4);")
- the function will generate sql script like this
-
ALTER TABLE cataloginventory_stock_item CHANGE qty qty DECIMAL(19,4); ALTER TABLE cataloginventory_stock_item CHANGE min_qty min_qty DECIMAL(19,4); ALTER TABLE cataloginventory_stock_item CHANGE min_sale_qty min_sale_qty DECIMAL(19,4); ALTER TABLE cataloginventory_stock_item CHANGE max_sale_qty max_sale_qty DECIMAL(19,4);
- copy generated sql script, execute on your mysql tools
- then reindex & flush cache
- voila!! problem solved 🙂
Comments are closed.