Skip to main content
Tweeted twitter.com/StackMagento/status/921258386330701824
added 1 character in body
Source Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239

I have a an an attribute with the input type "Dropdown"Dropdown named "Example Attribute""Example Attribute" and two Store Views.

This attribute has a few options, but only the "Admin"Admin values are set:

enter image description here

How can I programmically modify the values for each Store View? For example let's say I'd like to add the name of the Store View to each value:

enter image description here

I have found some very complicated answers which basically propose to completely overwrite all the values, but none did exactly what I need. I have tried various snippets of code that I found but none have worked for me. I've also looked through Magento's core classes but I was unable to find anything related to my problem.

I have a an attribute with the input type "Dropdown" named "Example Attribute" and two Store Views.

This attribute has a few options, but only the "Admin" values are set:

enter image description here

How can I programmically modify the values for each Store View? For example let's say I'd like to add the name of the Store View to each value:

enter image description here

I have found some very complicated answers which basically propose to completely overwrite all the values, but none did exactly what I need. I have tried various snippets of code that I found but none have worked for me. I've also looked through Magento's core classes but I was unable to find anything related to my problem.

I have an attribute with the input type Dropdown named "Example Attribute" and two Store Views.

This attribute has a few options, but only the Admin values are set:

enter image description here

How can I programmically modify the values for each Store View? For example let's say I'd like to add the name of the Store View to each value:

enter image description here

I have found some very complicated answers which basically propose to completely overwrite all the values, but none did exactly what I need. I have tried various snippets of code that I found but none have worked for me. I've also looked through Magento's core classes but I was unable to find anything related to my problem.

Source Link
Louis B.
  • 1.1k
  • 1
  • 11
  • 35

Programmatically update attribute option values for each Store View

I have a an attribute with the input type "Dropdown" named "Example Attribute" and two Store Views.

This attribute has a few options, but only the "Admin" values are set:

enter image description here

How can I programmically modify the values for each Store View? For example let's say I'd like to add the name of the Store View to each value:

enter image description here

I have found some very complicated answers which basically propose to completely overwrite all the values, but none did exactly what I need. I have tried various snippets of code that I found but none have worked for me. I've also looked through Magento's core classes but I was unable to find anything related to my problem.