1

Did anyone got the Add to cart API of magento working?


$mage_url = 'http://server_path/magento/api/?wsdl';

$mage_user = 'xxxxx';

$mage_api_key = 'xxxxx';

// Initialize the SOAP client $soap = new SoapClient( $mage_url );

// Login to Magento $session_id = $soap->login( $mage_user, $mage_api_key );

after this i want to do Add to cart

any suggestion..

4

1 回答 1

1

Magento 没有通过 SOAP API 产生该功能(截至 2010 年 12 月版本 1.4.2)。您现在必须自己实现。棘手的事情是更改它,以便它为通过 SOAP 创建的购物车创建会话对象,而不是通过带有 cookie 的用户浏览器进入的请求以及所有到结帐控制器的请求。

API 在当前版本中唯一做的就是创建一个购物车对象。没有其他的。好吧,甚至不是。它只是为给定的商店 ID 创建一个报价对象。

如这里 API 的实现类所示:

class Mage_Checkout_Model_Cart_Api extends Mage_Api_Model_Resource_Abstract
{
    public function create($store = null){...}
}
于 2010-12-23T14:48:03.277 回答