Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/240.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 未捕获错误:调用Magento 2中未定义的方法Magento\Quote\Api\Data\AddressExtension_Php_Magento2_Magento 2.3 - Fatal编程技术网

Php 未捕获错误:调用Magento 2中未定义的方法Magento\Quote\Api\Data\AddressExtension

Php 未捕获错误:调用Magento 2中未定义的方法Magento\Quote\Api\Data\AddressExtension,php,magento2,magento-2.3,Php,Magento2,Magento 2.3,我已经尝试在结账页面的发货和账单部分添加自定义字段(文本框)。 我有如下创建扩展属性: <?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd&q

我已经尝试在结账页面的发货和账单部分添加自定义字段(文本框)。 我有如下创建扩展属性:

<?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\Customer\Api\Data\AddressInterface">
        <attribute code="countrycode" type="string"/>
    </extension_attributes>
</config>


谢谢。

问题是extension\u attribute.xml文件

<extension_attributes for=""Magento\Customer\Api\Data\AddressInterface"">
            <attribute code=""countrycode"" type=""string""/>
        </extension_attributes>

以上代码应转换为

<extension_attributes for=""Magento\Quote\Api\Data\AddressInterface"">
            <attribute code=""countrycode"" type=""string""/>
        </extension_attributes>

请分享您在参考链接中遵循的所有步骤的代码。所以,对我们来说,解决这个问题很容易。
<extension_attributes for=""Magento\Quote\Api\Data\AddressInterface"">
            <attribute code=""countrycode"" type=""string""/>
        </extension_attributes>