magento2如何使用总计项目的扩展属性

时间:2016-11-30 09:34:58

标签: magento2

我尝试为总计项目设置新属性,以便在结帐产品摘要中将其显示在产品名称下方。我想使用"扩展属性"解决此问题的解决方案。我试图将其与购物车属性相似,这里所描述的内容http://zynovo.com/magento-2-extension-attributes/但对我来说它并不起作用。以下是我的代码

应用/代码/供应商/模块的/ etc / extension_attributes.xml

<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\TotalsItemInterface">
        <attribute code="producer" type="string"/>
    </extension_attributes>
</config>

就像上面链接教程中描述的那样,它应该生成新版本的TotalsItemInterface var / generation 目录,但是这并没有发生。我有开发者模式,我已经尝试清除此目录,但它没有帮助。如何为总计项目使用正确的扩展属性?

0 个答案:

没有答案