Retrieve active promotions in cart
Overview
Use this method to list all promotions applied to products added to cart.
Requirements
Parameters
Parameter | Type/Description |
---|---|
sessionID | Required (String) |
Session identifier, output of the Login method. An exception is thrown if the values are incorrect. |
Response
Parameter | Type/Description | |
---|---|---|
Promotion |
Array of objects |
|
|
Details below |
|
|
Name |
String |
|
|
Promotion name |
|
Description |
String |
|
|
Promotion description |
|
StartDate |
String |
|
|
Promotion start date. NULL for promotions that start immediately after they're created. |
|
EndDate |
String |
|
|
Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely. |
|
MaximumOrdersNumber |
Int |
|
|
When the maximum number of orders is reached the promotion stops. NULL if you want the promotion to apply to an unlimited number of orders. |
|
MaximumQuantity |
Int |
|
|
Discount only applies to a specific number of products, smaller than the maximum defined quantity. NULL if you want the promotion to apply to an unlimited number units. Any extra quantity added to the cart will be sold at full price. |
|
InstantDiscount |
Boolean |
|
|
Selecting the instant discount option auto-applies the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon. |
|
Coupon |
String |
|
|
Promotion coupon/voucher. |
|
DiscountLabel |
String |
|
|
Set discounts as percentage from the product price or as a fixed amount in the chosen currency. |
Request
<?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
try {
$Promotions= $client->getPromotions ($sessionID);
} catch (SoapFault $e) {
Echo "AllDiscounts: " . $e->getMessage();
exit;
}
var_dump ("AllDiscounts", $Promotions);
Errors
Error | Description |
---|---|
EMPTY_CART |
The shopping cart is empty |
NO_PROMOTIONS |
There are no promotions applied to current shopping cart |