I've created product drop-down attribute 'Types' for my project. But I want different values of that attribute for different category sections. For example: Let's say a category can be of type a) Fruits or b) Vegetables So for the category Fruits only options/values like Mango, Banana etc. should be visible and not the ones associated with Vegetables.
How to achieve this?
Best Answer
You could override the \Magento\Catalog\Block\Product\View\Attributes block and add a function to get the attribute set name:
Add something like this into overridden block:
Then from template you can grab a attribute set name and have more control over what attributes are shown for each product type:
This will replace the grid within the product tabs.