0

I need to add product custom added Customizable Options to the product Rest API. I have set that custom options to the below core Interface Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface and Model Magento\Catalog\Model\Product\Option\Value file and options in getting in product API.

But can't override interface so how to add as extension attributes or other override solution for below core dependency.

Core dependency file path: magento231\vendor\magento\module-catalog\etc\di.xml

<preference for="Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface" type="Magento\Catalog\Model\Product\Option\Value" />

I have find the issue from github. Can't able to add extenstion attributes for Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface

Github Issue link: https://github.com/magento/community-features/issues/30

Any help would be appreciated. Thanks!

  • can you show what you have added in those files? and what you want to achieve? – Rakesh Varma Oct 19 at 7:38
  • I have added Mageworxs product custom option like ColorCode, Images and Dependancy etc... – Kirti Nariya Oct 19 at 8:28
  • 1
    you can override Magento\Catalog\Model\Product\Option\Value class instead of interface or try plugin instead of override class – Rakesh Varma Oct 19 at 8:31
  • I tried to override Magento\Catalog\Model\Product\Option\Value class but not worked solution. – Kirti Nariya Oct 19 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.