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',
    ));

Magento cost price

if anyone can help me in this...

Was it helpful?

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
scroll top