I'm having a hard time wrapping my brain around how these extension attributes works. I sorta get how they work for an extension, but what I'm trying to do is extend a 3rd party extension's model to include a new database field that I've added to a table that the extension uses.
I have an extension that has the following in its etc/extension_attributes.xml
<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd"> <extension_attributes for="Magento\Quote\Api\Data\CartInterface"> <attribute code="aw_ctq_quote" type="Aheadworks\Ctq\Api\Data\QuoteInterface"> <join reference_table="aw_ctq_quote" reference_field="id" join_on_field="entity_id"> <field>id</field> <field>customer_id</field> <field>name</field> <field>created_at</field> <field>last_updated_at</field> <field>status</field> <field>expiration_date</field> <field>cart</field> <field>store_id</field> <field>base_quote_total</field> <field>quote_total</field> <field>base_quote_total_negotiated</field> <field>quote_total_negotiated</field> </join> </attribute> </extension_attributes> </config>
Like I said, I added a column to the the "aw_ctq_quote" table via an upgrade schema script in my custom module, and that added just fine. I have changed the PHTML template where this data gets entered by the backend user, and it does POST just fine. I'm trying to have the model update the data set now, but I have no idea how to tell Magento to also include this other field. I can't update the example XML because it's a composer extension.
How can I update the model to include this other field? I'm not sure how I can tell Magento to also include this other column. I started looking into extending interfaces but I'm not sure if I have to specify a new model or what exactly I need to be looking for. Every search I do turns up how to make your own interface with new extension attributes but no mention of extending/overriding an existing one.
Any pointers here would be fantastic. Thanks so much