Question

Magento 2 visibility "catalog" not saving in "default store view" but when store is "All store view" it is saving "catalog" but in default store view when visibility set "catalog" after save it is showing "catalog,search"

Using Magento 2.3.5p1

enter image description here Anyone how to solve this?

Was it helpful?

Solution

I think I know what's going on in there :) Your visibility attribute is set as global (in the default Magento installation, it has a store view level scope), so my assumption is that there was a change which said that your attribute has to be global from 'now on', but there are some old records in the database from the time when your attribute was 'store level scope'. that's why you see it like this.

first, double check that i am right :)

select * from catalog_product_entity_int where attribute_id in (select attribute_id from eav_attribute where attribute_code='visibility' and entity_type_id=4) and store_id > 0 and entity_id=<your_product_id>;

this query will return results if my assumption is correct. so if you want to keep the 'visibility' attribute as global and make it behave correctly on this product, then delete the line:

delete from catalog_product_entity_int where attribute_id in (select attribute_id from eav_attribute where attribute_code='visibility' and entity_type_id=4) and store_id > 0 and entity_id=<your_product_id>;

make sure you are replacing the '<your_product_id>' with your product's entity_id.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top