【问题标题】:Clear cart after order using Magento SOAP API使用 Magento SOAP API 下单后清除购物车
【发布时间】:2017-04-17 05:23:14
【问题描述】:

我已经在 Magento 中创建了用于下订单的 API,但问题是当我下订单时,购物车不会变空,产品仍会出现在购物车中。如何清除我的购物车?

【问题讨论】:

    标签: magento-1.9


    【解决方案1】:

    你需要使用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

    【讨论】:

    • 但这是简单的产品,我也只有可配置的产品我怎样才能通过购物车中的所有产品来删除。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-02
    • 2019-11-02
    • 2011-04-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多