We are having a problem that DW is not deleting product from everywhere.
For example : I have created product with unique ID ("7897897987"), then deleted it in back-end (second mouse -> delete), then i run my custom scripts, that loops throughout all products and checks if product id is equal to 7897897987, and i still get positive answer.
Codes:
loop throughout all products
foreach (Product checkExistsProduct in productCollection2)
{
if (checkExistsProduct.ID == (string)productInfo[0])
{
productExists = true;
}
}
//if product needs to be deleted
if (Base.ChkNumber(productInfo[12]) == 1)
{
foreach (Product checkExistsProduct in productCollection2)
{
if (checkExistsProduct.Number == (string)productInfo[0])
{
Product.Delete(checkExistsProduct.ID);
}
}
}
Thank you.