[-] BO: Delete specific price after combination deletion && fix SpecificPrice::getByProductId() sql query
This commit is contained in:
1 parent
db7f0da746
commit
ee1187d821
2 files changed
+8
-1
No files matched your search
@@ -103,6 +103,13 @@ class CombinationCore extends ObjectModel
|
|||||||
// Removes the product from StockAvailable, for the current shop
|
// Removes the product from StockAvailable, for the current shop
|
||||||
StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id);
|
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())
|
if (!$this->hasMultishopEntries() && !$this->deleteAssociations())
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class SpecificPriceCore extends ObjectModel
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM `'._DB_PREFIX_.'specific_price`
|
FROM `'._DB_PREFIX_.'specific_price`
|
||||||
WHERE `id_product` = '.(int)$id_product.
|
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);
|
AND id_cart = '.(int)$id_cart);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user