0

I've updated an attribute using Mage Code, when I check the product View page, the attribute value is updated correctly. But in the admin area, the attribute is not updated, I've cleared cache, but the value attribute in the admin area is the same and in the product view is the new value.

I've installed Magento 1.8.0 CE

This is the pseudo script

$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku[$i]);
  $productIds[$i] = $_product->getId(); // get the product Id
  $attrData[$i] = array("tiempo_entrega" => $tiempo[$i]); // the attribute to update
0

When you want to save something, you do:
$product->setData('your_attribute','your value');
$product->save();
Did you do that?

  • Yes, I did, but by doing that way, the script consuming too many resources and execution time rises too. Is there any way to update attribute product's massively without runtime rise ? I'll try again with setData() and save() methods. – Andres Santana Jan 24 '15 at 0:49
  • If you want to see your changes on backend - you have no other option than to save() your changes. If you want to refactor your database calls - it's another question. There are many ways to do it and a lot of different work to do as well. Try to find some information on filter Magento collections. – Amberta Jan 27 '15 at 9:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.