1

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?

4
  • Could you please let us know for which section are you talking about? – Dhara Bhatti Mar 5 at 12:47
  • @DharaBhatti when adding product from admin – sumeet bajaj Mar 5 at 12:55
  • Check that the scope for the visibility attribute is set to Global or Store View. – paj Mar 5 at 13:55
  • @paj visibility attribute is already set to Global – sumeet bajaj Mar 5 at 13:57
1

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.

9
  • for this conditions what i have to do now ? – sumeet bajaj Mar 5 at 13:57
  • if you want to keep the attribute as global, you need to delete the store view values from the database, i will update my answer. – Diana Botean Mar 5 at 14:00
  • i updated my answer above with the queries you need to first validate the theory, then make it work for your product. – Diana Botean Mar 5 at 14:06
  • i have lots of products which we are facing so how can we for multiple products ? – sumeet bajaj Mar 5 at 14:41
  • 1
    it is working fine(run delete SQL command which you shared) on my localhost, hope it will work on live website without any errors. – sumeet bajaj Mar 8 at 13:59

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.