[-] BO: Delete specific price after combination deletion && fix SpecificPrice::getByProductId() sql query
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -135,7 +135,7 @@ class SpecificPriceCore extends ObjectModel
|
||||
SELECT *
|
||||
FROM `'._DB_PREFIX_.'specific_price`
|
||||
WHERE `id_product` = '.(int)$id_product.
|
||||
($id_product_attribute ? 'AND id_product_attribute = '.(int)$id_product_attribute : '').'
|
||||
($id_product_attribute ? ' AND id_product_attribute = '.(int)$id_product_attribute : '').'
|
||||
AND id_cart = '.(int)$id_cart);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user