cancel
Showing results for 
Search instead for 
Did you mean: 

Disable product on default value

SOLVED

Disable product on default value

I want to disable product on all store views including default values.

I have stores as shown below in the image.

I am disabling the product by getting all stores but by this I am unable to disable the product on default values. How can I disable it on default values.

 

Screenshot from 2018-11-15 19-37-31.png

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Disable product on default value

Hello @dharinee_choubisa

 

You can disable the products on default values like this

Mage::getModel('catalog/product_status')->updateProductStatus($product_id, 0, Mage_Catalog_Model_Product_Status :: STATUS_DISABLED)

 

As the store id for default values is set to 0. So, you can update your code like this.

 

If found my answer useful? Please give Kudos and Accept it as Solution.

Magento Developer
Ankita Biswas

View solution in original post

1 REPLY 1

Re: Disable product on default value

Hello @dharinee_choubisa

 

You can disable the products on default values like this

Mage::getModel('catalog/product_status')->updateProductStatus($product_id, 0, Mage_Catalog_Model_Product_Status :: STATUS_DISABLED)

 

As the store id for default values is set to 0. So, you can update your code like this.

 

If found my answer useful? Please give Kudos and Accept it as Solution.

Magento Developer
Ankita Biswas