Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 523 Bytes

deleteproduct.md

File metadata and controls

18 lines (13 loc) · 523 Bytes

Delete product

To delete a product, we must have a product before hand.

We can use the UpdateProduct type

use Lsv\Datapump\Product\AbstractProduct;
use Lsv\Datapump\Product\Data\DeleteProduct;
use Lsv\Datapump\Product\UpdateProduct;

$product = new UpdateProduct();
$product->setSku('sku-of-product-that-needs-to-be-deleted');
$product->setType(AbstractProduct::TYPE_SIMPLE); // The type of the product is needed
$product->addData(new DeleteProduct());

Now just inject the $product to the itemholder