Remove product from cart
Use this method to remove a product that was added to the shopping cart, during the current session.
Request parameters
sessionID
Required (string) Session identifier, which is the output of the Login method. An exception is thrown if the values are incorrect.
productId
Required (integer) Unique product identifier from the Avangate system.
priceOptions
Optional (stringArray) Array of price options codes. These identifiers mark the individual options inside pricing options configuration groups. This parameter must match exactly the pricing option combination of the product added to the cart in order for the product to be removed. Partner orders can involve the same product, but ordered in multiple instances, each with different pricing options. Can be NULL.
quantity
Optional (integer) Defines the number of product units added to cart that should be removed. If no quantity info is provided, the product is completely removed from cart. Can be NULL.
Request sample
<?php
require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
require('PATH_TO_addProduct'); // addProduct example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/08Place_an_order/00Add_product_to_cart
$productId = 'YOUR_PRODUCT_ID';
$priceOptions = array(
'Pricing_options_group_code1',
'Pricing_options_group_code2'
);
$quantity = YOUR_QUANTITY;
try {
$RemoveProduct= $client->deleteProduct ($sessionID, $productId, $priceOptions, $quantity);
} catch (SoapFault $e) {
echo "ProductDeleted: " . $e->getMessage();
exit;
}
var_dump ("ProductDeleted ", $RemoveProduct);Response parameters
Result
Boolean True or false
Errors
EMPTY_CART
The shopping cart is empty.
PRODUCT_ERROR
There is no product with the specified settings in cart.
Last updated
Was this helpful?