I want to get the locations from custom_location table values to custom product attribute multi-select box.
custom_location values like:
1 – location_1
2 – location_2
3 – location_3
4 – location_4
How can i get these values to magento 2 product attribute multiple select box?Thanks for helping
Best Answer
You need to create model for custom_table(Ignore if already made) by following link - https://www.mage-world.com/blog/how-to-use-model-and-collection-in-magento-2.html
Now make new mmodule say: Vendor_Module
Create InstallData.php under app/code/Vendor/Module/Setup/InstallData.php and copy below code & make changes as per your naming convention:-
Create Options.php under Vendor/Module/Model/Config/Source and paste Below Code & make changes as per your naming convention: