Magento does not remove storeview data when scope changes

今天我做了个有趣的实验:

  1. 首先 Manage Attributes,设置某 product attribute ‘my_attr’ scope 为 Store view
  2. 然后 Manage Products,为 my_attr 设置 default value ‘aaa’,再设置 store view (假设 storeId = 2) value ‘bbb’
  3. 然后 Manage Attributes, 把 my_attr scope 改为 Global
  4. 然后 Manage Products,Choose Store View (storeId = 2),这时仍可见 my_attr 显示值 ‘bbb’。It means although my_attr scope is changed to ‘Global’, but old store view specific values are not removed.
  5. 这时 (my_attr scope is Global) 如果在 Store View (storeId = 2) 状态把 my_attr 的值改为 ‘ccc’,then Save Product。my_attr default value 被改为 ‘ccc’,store view (storeId = 2) value 仍为 ‘bbb’。It means when my_attr scope is ‘Global’, it is not possible using Manage Products GUI to change or remove existing store view value.

摸清 Magento 的规律后就容易理解 Manage Products GUI 在 scope 改变或 store view 切换时的行为。另文有提及 change product default value and store view view by programming.

Leave a Reply

Your email address will not be published. Required fields are marked *