Jump to content

WebService Prestashop : unable to update attributes product quantities


t-prod

Recommended Posts

Hi,

I'm using the Prestashop WebService 1.7.4.2 and I try to update attributes products quantities but it doesn't work at all :

I have a product and 5 combinations and the stock_availables endpoint only list product parent but not the attributes

image.png.03234bb6b3c10d1f3aaa6bdc2584d677.png

I try to update like this :

$combination = Prestashop::get(
    [
        'resource' => 'combinations',
        'id' => (int) $product_combination->id
    ]);
$putXmlCombination = Prestashop::fillSchema($combination, ['quantity' => 5], false);
Prestashop::edit(
[
    'resource' => 'combinations',
    'putXml' => $putXmlCombination->asXml(),
    'id' => (int) $product_combination->id
]);

But combination quantity is not updated at all in BO despite the fact the return is good :

image.png.f4f0a102e3a756ba004ed63900145a91.png

In BO : It should be 5 but it's 4 :(

image.thumb.png.ee1a486df5e50b93aa70ddbd8a05af4a.png

Regards

image.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...