Magento Product Grid 'Cost Price' 3 decimal place
-
29-09-2020 - |
Question
I want 3 decimal places for "cost" like the "Price"
app/code/local/Mage/Adminhtml/Block/Catalog/Product/Grid.php
$store = $this->_getStore();
$this->addColumn('cost',
array(
'header'=> Mage::helper('catalog')->__('Cost'),
'width' => '80px',
'currency_code' => $store->getBaseCurrency()->getCode(),
'index' => 'cost',
));
$this->addColumn('price',
array(
'header'=> Mage::helper('catalog')->__('Price'),
'type' => 'price',
'currency_code' => $store->getBaseCurrency()->getCode(),
'index' => 'price',
));
$this->addColumn('special_price',
array(
'header'=> Mage::helper('catalog')->__('Special Price'),
'type' => 'price',
'currency_code' => $store->getBaseCurrency()->getCode(),
'index' => 'special_price',
));
if anyone can help me in this...
Solution
Please use below code for add column
$this->addColumn('cost',
array(
'header'=> Mage::helper('catalog')->__('Cost'),
'width' => '80px',
'currency_code' => $store->getBaseCurrency()->getCode(),
'type' => 'price',
'index' => 'cost',
));
OTHER TIPS
It is working fine with this code now
$store = $this->_getStore();
$this->addColumn('cost',
array(
'header'=> Mage::helper('catalog')->__('Cost'),
'width' => '80px',
'type' => 'price',
'currency_code' => $store->getBaseCurrency()->getCode(),
'index' => 'cost',
));
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange