I'm trying to add an extension attribute to \Magento\Quote\Api\Data\TotalsInterface
. My understanting is, that magento should generate getter/setter
for the new attribute, but that is not happening. (i tried deleting var/generation
var/cache
multiple times)
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\TotalsInterface">
<attribute code="custom_attribute" type="string"/>
</extension_attributes>
</config>
Is my understanding correct, or is this just not possible?
The interface is instantiated using factory in Magento\Quote\Model\Cart\CartTotalRepository
. Could that have an effect?
Any help would be greatly appreciated.