我已经在Magento创建了订购地点的API,但问题是当我下订单时,购物车不会变空,产品仍会出现在购物车中。我怎样才能清理我的购物车?
答案 0 :(得分:0)
您需要使用shoppingCartProductRemove (SOAP V2)
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
$sessionId = $proxy->login('apiUser', 'apiKey');
$result = $proxy->shoppingCartProductRemove($sessionId, 10, array(array(
'product_id' => '4',
'sku' => 'simple_product',
'qty' => '1',
'options' => null,
'bundle_option' => null,
'bundle_option_qty' => null,
'links' => null
)));
var_dump($result);
有关详细信息,请参阅:Product Remove