cancel
Showing results for 
Search instead for 
Did you mean: 

"Use Default Values" Checkbox Unchecked While Update Product Programatically

SOLVED

"Use Default Values" Checkbox Unchecked While Update Product Programatically

Hello,

 

Can anyone help me to figure out the issue?

I am using $Prodcut->save(); this code to update product from code and the values are updating but "Use Default Values". Please see the attached screenshot also.

 

Thanks,

Rahul Y

 

issue.png

1 ACCEPTED SOLUTION

Accepted Solutions

Re: "Use Default Values" Checkbox Unchecked While Update Product Programatically

I have fixed this issue with the following changes in my code.

 

$productIDs[] = $productID;
$productActionObject = $objectManager->get('Magento\Catalog\Model\Product\Action');
$productActionObject->updateAttributes($productIDs, array('price' => $v4['Price']), 0);

 

This is working. Please close this ticket.

 

Thanks & Regards

Rahul yadav

View solution in original post

5 REPLIES 5

Re: "Use Default Values" Checkbox Unchecked While Update Product Programatically

Can anyone help me to figure out this?

Re: "Use Default Values" Checkbox Unchecked While Update Product Programatically

I have fixed this issue with the following changes in my code.

 

$productIDs[] = $productID;
$productActionObject = $objectManager->get('Magento\Catalog\Model\Product\Action');
$productActionObject->updateAttributes($productIDs, array('price' => $v4['Price']), 0);

 

This is working. Please close this ticket.

 

Thanks & Regards

Rahul yadav

Re: "Use Default Values" Checkbox Unchecked While Update Product Programatically

can you explain it in brief

Re: "Use Default Values" Checkbox Unchecked While Update Product Programatically

I'm bit confused in How to use it in my code 

please explain it in brief.

 

Re: "Use Default Values" Checkbox Unchecked While Update Product Programatically

I'm having the same issue. Looked this problem up and it seems that this is still a known issue in the codebase. Please verify if this is the suggested solution to this existing bug reported in the link below.

https://github.com/magento/magento2/issues/26484