将产品添加到购物车magento soap时出错

将产品添加到购物车magento soap时出错,magento,soap,Magento,Soap,当我试图通过soap API将产品添加到Magento中的购物车时,会出现以下错误: SoapFault:对非对象调用成员函数setFinalPrice() 我采取以下步骤: 创建购物车($this->call($this->_session,'cart.create',array($store))) 设置客户地址和信息(cart\u customer.set、cart\u customer.addresses) 当调用(cart.info)时,会产生以下数组: 但是当我尝试使用以下数组执行

当我试图通过soap API将产品添加到Magento中的购物车时,会出现以下错误: SoapFault:对非对象调用成员函数setFinalPrice()

我采取以下步骤:

  • 创建
    购物车($this->call($this->_session,'cart.create',array($store)))
  • 设置客户地址和信息(cart\u customer.set、cart\u customer.addresses)
调用(cart.info)
时,会产生以下数组:

但是当我尝试使用以下数组执行(cart\u product.add)时:

Array
(
     'sku' => '44567788855',
     'quantity' => 1
 )
我得到了关于
setFinalPrice
的错误

问题是,我无法访问此Magento安装(仅API帐户)。我使用了这个网站(http://www.magentocommerce.com/api/soap/checkout/cartProduct/cart_product.add.html)对于所有示例代码

使用产品标识而不是sku有效。不知何故,这不起作用,但已记录在其API中

请参考此

这可能会对你有所帮助。我也厌倦了使用产品id代替sku来执行(cart\u product.add)。它工作得很好

请核对我的要求

 <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:shoppingCartProductAdd soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionId xsi:type="xsd:string">d77fdb68c787871ce1373001120b1520</sessionId>
         <quoteId xsi:type="xsd:int">1</quoteId>
         <products xsi:type="urn:shoppingCartProductEntityArray" soapenc:arrayType="urn:shoppingCartProductEntity[]">
<product_id xsi:type="xsd:string">2</product_id>
</products>
         <storeId xsi:type="xsd:string">0</storeId>
      </urn:shoppingCartProductAdd>
   </soapenv:Body>
</soapenv:Envelope>

D77FDB68C7871CE1373001120B1520
1.
2.
0
我的回答是

    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:shoppingCartProductAddResponse>
         <result xsi:type="xsd:boolean">true</result>
      </ns1:shoppingCartProductAddResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

真的
我正在使用SOAP客户端测试SOAP


祝你好运

你链接到的链接已失效。你能把答案贴在这里吗?
    <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <ns1:shoppingCartProductAddResponse>
         <result xsi:type="xsd:boolean">true</result>
      </ns1:shoppingCartProductAddResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>