cancel
Showing results for 
Search instead for 
Did you mean: 

Update new custom field in table from model

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

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!