I have created a product attribute that is using an image swatch for each attribute value.
My question is how can I go about retrieving the image swatch URL from the attribute within my product view?
I am familiar with how to retrieve an attribute value but can't seem to figure out how to retrieve the image swatch.
Any help would be great.
Best Answer
To retrieve that value, you need the next in your block or viewModel (https://www.yireo.com/blog/1856-viewmodels-in-magento-2)
swatch_attribute is the attribute code.