[-] BO : cart rules are now cleaned when a component of a product rule (like a product, a category, a supplier...) is deleted
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16548 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+8
-1
@@ -672,7 +672,8 @@ class ProductCore extends ObjectModel
|
||||
!$this->deleteAccessories() ||
|
||||
!$this->deleteFromAccessories() ||
|
||||
!$this->deleteFromSupplier() ||
|
||||
!$this->deleteDownload())
|
||||
!$this->deleteDownload() ||
|
||||
!$this->deleteFromCartRules())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -690,6 +691,12 @@ class ProductCore extends ObjectModel
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function deleteFromCartRules()
|
||||
{
|
||||
CartRule::cleanProductRuleIntegrity('products', $this->id);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteFromSupplier()
|
||||
{
|
||||
return Db::getInstance()->delete('product_supplier', 'id_product = '.(int)$this->id);
|
||||
|
||||
Reference in New Issue
Block a user