I want to set a value to a dropdown attribute.
I try to use $product->setSize("M")
but it is set to null.
Do I need to create the option of dropdown attribute ?
magento2product
I want to set a value to a dropdown attribute.
I try to use $product->setSize("M")
but it is set to null.
Do I need to create the option of dropdown attribute ?
Best Answer
I am amused , you want dynamic drop-down for Product attribute then you should create custom attribute with dynamic Source: from
Setup/UpgradeData.php
script:I hope it will help you.