0

Magento 2 I am trying to change product data - first time it is working fine, when i tried to change same attribute second time it not updating which i selected data

  • any error message or any log generated ?? – Rk Rathod May 8 '19 at 15:37
  • @RkRathod No,it showing You saved the product. if i change default magento attributes those working fine custom attributes means if create new attribute pawan if i change this attribute it not working – Pawankumar May 9 '19 at 9:58
0

In my case the product class overrided Magento\Catalog\Model\Product and using

 $this->load($this->getId())->getData('My_Custom_Attribute'); 

to get my attribute because $this->getData('My_Custom_Attribute'); was returning Null;

Reloading the product cause to un-updating the product "using load() function"

so recheck your plugin and try to disable them 1 by 1

here is my problem: plugin code:

$product->load($product->getId()); //Here my main product get overrided

Replaced with:

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
 $objectManager->create('Magento\Catalog\Model\Product')->load($product->getId());
| improve this answer | |

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.