Remove products
Last updated: 15-Oct-2019
Rate this article:
Overview
Use deletePromotionProducts to remove products from an existing promotion.
Parameters
Parameter | Type/Description | |
---|---|---|
promotionCode |
Required (string) |
|
|
The code corresponding to the promotion that you want to remove products from. |
|
promotionProducts |
Required (object) |
|
|
Code |
Required (string) |
|
|
System generated product code. |
|
pricingConfigurationCode |
Required (string) |
|
|
System generated pricing configuration code. |
|
pricingOptionCodes |
Required (array of strings) |
|
|
Pricing option codes that you control. |
Response
Parameter | Type/Description |
---|---|
Status | Boolean |
True or False |
Request
<?php
require ('PATH_TO_AUTH');
// Define the first product to remove from the promotion
$newProduct1 = new stdClass;
$newProduct1->Code = '';
$newProduct1->PricingConfigurationCode = '';
$newProduct1->PricingOptionCodes = ['',''];
// Define another product to remove from the promotion
$newProduct2 = new stdClass;
$newProduct2->Code = '';
$newProduct2->PricingOptionCodes = [''];
$promotionProducts = [$newProduct1, $newProduct2];
try {
$updatedPromotion = $client->deletePromotionProducts ($promotionCode, $promotionProducts);
}
catch (SoapFault $e) {
echo "UpdatedPromotion: " . $e->getMessage();
exit;
}
var_dump("UpdatedPromotion", $updatedPromotion);
Rate this article: