Showing results for 
Search instead for 
Did you mean: 

Extension Attributes for CustomOptionInterface

Extension Attributes for CustomOptionInterface

Hi. I'm developing a module where I want to add a new entity called "course" and I want to create an "extension attribute" to allows to the customers to select a course on the moment they are adding products to his shopiing cart.


In my module, I have created an extensions_attributes.xml

<?xml version="1.0"?>
   <extension_attributes for="\Magento\Catalog\Api\Data\CustomOptionInterface">
      <attribute code="course" type="datatype">
            <resource ref="Magento_CatalogInventory::cataloginventory" />
         <join reference_table="ie_course" reference_field="course_id" join_on_field="entity_id">



After I cleared the var directory and regenerate the depencendy injections class I think I would see the methods getCourse and setCourse on a file called /var/generation/Magento/Catalog/CustomOptionInterface.php but this file doesn't exists


The most similar file is ProductOptionsExtensionInterface.php but I didn't find anything related with my new methods


Maybe I misunderstood some concepts of the Magento Documentation. These are the links I'm following


Could you please point me on the right direction?



Thanks very much!