When we create / edit product, then we select category and website, for store views whose category is not selected, the visibility should be set to "not visible".
Is it possible by default?
multistoreproductproducts-management
When we create / edit product, then we select category and website, for store views whose category is not selected, the visibility should be set to "not visible".
Is it possible by default?
Best Answer
Not possible by default, no. You could try to write an observer for
catalog_product_prepare_save
, which is dispatched from the product save controller and receives the parametersproduct
andrequest
.But with a single
save
, only one store view can be saved, so you cannot achieve what you want with manipulating the product object alone. You have to save the visibility attribute directly. Fortunately, there is a method for it:addAttributeUpdate($code, $value, $store)