mallgroup / mpapi-client-php

MPAPI client is a PHP tool created to help Internet Mall, a. s. partners easily manage article catalog, deliveries, orders, etc. using Mall Marketplace API.
Apache License 2.0
6 stars 19 forks source link

Product Availability Batch update #22

Closed Engazan closed 2 years ago

Engazan commented 3 years ago

Zdravím je neaka možnosť ako cez tento Mall wrapper dokážem urobiť "batch update availability"?

https://marketplaceapiv2.docs.apiary.io/#reference/availability/batch-update-of-productvariant-availability/batch-availability-change-for-products-and-variants

Skúšal som toto, ale jedna chyba za druhou ako "Missing key category_id" a iné ...

$products = new Products($client)

$product = new Product();
$product->setId($sku);
                ->setStatus($status);
                ->setInStock($mainStock);

$variant = new Variant();
$variant->setId($variantId)
               ->setId($variantSku)
               ->setStatus($variantStatus)
               ->setInStock($variantInStock);
$product->addVariant($variant);

$products->add($product)
                  ->put();
michalsalon-mall commented 3 years ago

Hello,

current v3 of the client does not support batch endpoints. Sorry.

New version 4, with support for batch endpoints, stricter types etc. is currently in development and should be released relatively soon™.

michalsalon-mall commented 3 years ago

Hi, a new beta version with support for Batch update was released: v4.0.0-beta

It's still a work in progress, but should not change much, and any comments and suggestions are appreciated.

qwerin commented 2 years ago

Hi, a new beta version with support for Batch update was released: v4.0.0-beta

It's still a work in progress, but should not change much, and any comments and suggestions are appreciated.

Zatím verze 4 je nepoužitelná chybí tam jedna zásadní funkce a to je vytvořit produkt jinak než z api -> private function __construct( ... a ješte k tomu je to final class takže bez moznosti rozšíření.. Takže zbývá jen pomocí metody createFromApi a to je nic moc pro nějakou slušnou implementaci.

michalsalon-mall commented 2 years ago

Hi,

to create a product or variant, the Product/Variant request DTO's should be used: ProductRequest VariantRequest

If you try to call createProduct method, your IDE should tell you the required parameter type.

Please let us know if you have any other problems.

Thank you.

michalsalon-mall commented 2 years ago

Implemented in v3.14.0.