[-] BO: Delete specific price after combination deletion && fix SpecificPrice::getByProductId() sql query

This commit is contained in:
Rémi Gaillard
2013-07-15 11:00:35 +02:00
parent db7f0da746
commit ee1187d821
2 changed files with 9 additions and 2 deletions
+8 -1
View File
@@ -102,7 +102,14 @@ class CombinationCore extends ObjectModel
// Removes the product from StockAvailable, for the current shop
StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id);
if ($specific_prices = SpecificPrice::getByProductId((int)$this->id_product, (int)$this->id))
foreach ($specific_prices as $specific_price)
{
$price = new SpecificPrice((int)$specific_price['id_specific_price']);
$price->delete();
}
if (!$this->hasMultishopEntries() && !$this->deleteAssociations())
return false;
return true;