سؤال

When attempting to change scope from "Store View" to "Global" of an attribute that's used as super attribute, I get this error message:

"Scope must not be changed, because the attribute is used in configurable products."

I know that probably there is a good reason, can somebody explain me the logic behind this?

هل كانت مفيدة؟

المحلول

Store View Scope means you can have a value for the Default Scope (Global) and a different value for the Store view.

You have the following situation:

Store view: Global Scope Value, Store View Value:

store view 1: A,B

store view 2: A,C

If you change the scope from Store View to Global and you have products that already have values sets, Magento doesn't know what to do with the values. What values should we keep? A (the global one), B (the store view one). That is why you get the message.

The check is in Mage_Catalog_Model_Resource_Eav_Attribute::_beforeSave():

[...]
     if (($this->_data['is_global'] != $this->_origData['is_global'])
                && $this->_getResource()->isUsedBySuperProducts($this)) {
                Mage::throwException(Mage::helper('catalog')->__('Scope must not be changed, because the attribute is used in configurable products.'));
            }
[...]

You do have the following options:

  • if you didn't use that attribute yet, just delete it and create it again
  • if you are using it, create a new one and use import/export to update the values
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى magento.stackexchange
scroll top