Closed E-GOO closed 3 years ago
I also encountered the same problem
$request->setOffers([
[
'product_id' => 'product_id',
'shop_sku' => shop_sku',
'product_id_type' => 'SKU',
'internal_description' => 'internal_description',
'price' => '29.99',
'discount-price' => '19.99',
'quantity' => '0',
'state_code' => 11,
'update_delete' => 'update',
]
]);
$result = $api->updateOffers($request);
And the discount price has not been updated, while the price and quantity have been updated.
Hello,
I think the problem is on the data format. The discount price must be specified like that:
$request->setOffers([
[
'product_id' => 'product_id',
'shop_sku' => shop_sku',
'product_id_type' => 'SKU',
'internal_description' => 'internal_description',
'price' => '29.99',
'discount' => [
'price' => '19.99'
],
'quantity' => '0',
'state_code' => 11,
'update_delete' => 'update',
]
]);
Can you try and tell us if it is working please?
Hi @jreinke,
Yes, after changing the structure, everything works. Thank you so much
'discount' => [
'price' => '19.99'
],
Thanks for your feedback.
I am trying to update the price and discount price in a sale.
My question is the following:
$api = new ShopApiClient(_APIURL, $apiKey, $shopID);
$offer_array = array( 'product_id' => '8433268000277', 'product_id_type' => 'EAN', 'shop_sku' => 'NovaDecoLitleBL', 'quantity' => 20, 'price' => 700, 'discount-price' => 370, 'state_code' => 11, 'update_delete' => 'update' );
$request = new UpdateOffersRequest(); $request->setOffers(new UpdateOfferCollection(array($offer_array))); $result = $api->updateOffers($request);
But the discount-price is not changed
Does anyone know how it would be done?