1

I create a product custom attribute programatically. The scope was WEBSITE. But now I just realised that this attribute must have the scope as STORE, because I need different values according to the store view.

I changed the scope in backend, clean the cache, and when I went to edit the product, the scope was correct [STORE]. Then I change store, view so I can insert the value for the store view and the scope changed to [WEBSITE].

I went back and the scope was wrong again [WEBSITE].

I went again to the attribute (Stores > Attributes > Product), choose my attribute, and the attribute had the right scope. I didn't change anything, only save the attribute again and clean the cache. Then I edit the product and the scope was correct [STORE], then I change store view and the scope was wrong again [WEBSITE].

I check database and the attribute is ok.

Did this happening to anyone? Anyone has a clue about this?

Thank you

1

You've probably solved your problem, but here is solution for people coming here from google as me. I've managed it by editing it straight in database.

It's not recommended to do such things - the safest way is to delete this attribute and add it again, but sometimes you have no choice. This is e.g. how to change attribute scope to GLOBAL.

UPDATE catalog_eav_attribute SET is_global = 1, apply_to = 'simple,virtual,configurable' WHERE attribute_id = YOUR_ATTRIBUTE_ID;

And then refresh cache.

0

Try to run this command:

bin/magento indexer:reindex

bin/magento setup:static-content:deploy
  • I did this already and didn't solve the issue. thank you – mvistas Dec 14 '17 at 12:23

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.