cancel
Showing results for 
Search instead for 
Did you mean: 

Update new custom field in table from model

Update new custom field in table from model

I add custom field "currency_code" to table "catalog_product_entity".

And now I want save data for this field from model.

 

$product = Mage::getModel('catalog/product')->loadByAttribute('sku', '123456');

// it's work
echo $product->getData('currency_code');
echo $product->currency_code;

$product->setCurrencyCode('EUR');
$product->save();

// after that the field is not updated

 

1 REPLY 1

Re: Update new custom field in table from model

Hi @Dev100,

Try once using setData method:

$data = array('currency_code'=>'EUR');
$product->setData($data);
$product->save();

I hope it will help you!