We’re rewarding the question askers & reputations are being recalculated! Read more.

New answers tagged

0

I also faced the issue. After doing some investigation I found that has_options column has 0 but product have at least one option associated in the product options table. I didn't find a scenario to reproduce but it seems the product options were imported by any third party extension or migrated from an older version of Magento. Re-saving product resolves ...


0

Finally I have added product custom option value to product Rest API using Plugin Magento\Catalog\Model\Product\Option\ReadHandler class. Follow below file path to create custom module and add the product custom option value to the Product Rest API. File path: magento/app/code/Vendor/ProductoptionsApi/registration.php <?php \Magento\Framework\...


0

You can achieve this by creating the Extension attributes. Refer to this link: https://www.zynovo.com/blog/magento-2-extension-attributes/


0

My working version based on @philwinkle's response: $installer = $this; $installer->startSetup(); $tableOptions = $installer->getTable('eav_attribute_option'); $tableOptionValues = $installer->getTable('eav_attribute_option_value'); $attributeId = (int) $installer->getAttribute('customer', 'gender', 'attribute_id'); $attributeLabel = 'Diverse'...


0

This is the property/bug of Magento custom attribute where it will create records in eav table only after we save that particular product manually. Otherwise the attribute returns a NULL value. So if you need to get the value for product_badge attribute you need to save that particular product and check from the front end.


0

Magento 2 does not allow us to override the interfaces. You can use Extension attributes for these things you can get help from online docs how to create Extension attributes in Magento 2 for interfaces.


0

You can create a custom module and with help of layout and observer, you can display customized option value in the shopping cart view. I assume you will create a custom module name "Company_MyModule". So create an empty module with the name "Company_MyModule" (or anything you like) and after that follow the steps below to create other files. NOTE : This ...


2

create an observer using checkout_cart_product_add_after event into Vender/CustomModule/etc/frontend/events.xml <event name="checkout_cart_product_add_after"> <observer name="change_custom_option" instance="Vender\CustomModule\Observer\ChangeCustomOption" /> </event> then create observer into Vender\CustomModule\Observer/...


1

you have to change your code in observer file public function execute(Observer $observer) { $item = $observer->getEvent()->getData('quote_item'); $item = ( $item->getParentItem() ? $item->getParentItem() : $item ); $_product = $item->getProduct(); $options = $_product->getTypeInstance(true)...


1

I took a quick look and I think you have to work around this class \Magento\Catalog\Model\Product\Option, there is a method called addValue() which is a public function. You might do a plugin. Hope it helps.


Top 50 recent answers are included