How to Remove Products¶
Instantiate the Remover¶
The product remover is a service, you can fetch it from the container.
$remover = $this->getContainer()->get('pim_catalog.remover.product');
Remove the Products¶
It implements Akeneo\Tool\Component\StorageUtils\Remover\RemoverInterface
and Akeneo\Tool\Component\StorageUtils\Remover\BulkRemoverInterface
so you can remove one or several products.
$remover->remove($product); // To remove one product
$remover->removeAll($products); // To remove a collection of products
Found a typo or a hole in the documentation and feel like contributing?
Join us on Github!