webgriffe/SyliusAkeneoPlugin

Product model not enqueued if modified

Closed this issue · 2 comments

It seems that if someone modify a product model on Akeneo (without changing any variant-specific attribute, only model ones) the related variant products are not enqueued byt the Product importer.

Maybe is because in such situation Akeneo APIs do not return variants (products) as modified since the given date. Only parent product (product model). If this is the case, here:

/**
* {@inheritdoc}
* @psalm-return array<array-key, string>
*/
public function getIdentifiersModifiedSince(\DateTime $sinceDate): array
{
$products = $this->apiClient->findProductsModifiedSince($sinceDate);
$identifiers = [];
foreach ($products as $product) {
Assert::string($product['identifier']);
$identifiers[] = $product['identifier'];
}
return $identifiers;
}

We should also enqueue products of those product models modified since the given date.

Maybe this could be resolved with #157

Maybe this could be resolved with #157

Nope.

But I suggest adding a new ProductModel importer. This product model importer should dispatch N product import messages for any product in the product model. This will also solve a bug in the current version. If you submit the import of a product in the admin only the variants already existing in Sylius will be imported, not all the products on Akeneo!