Catalog rule and cart rule applied on all product types
This commit is contained in:
parent
77563c57f1
commit
fafa0df14a
|
|
@ -133,17 +133,8 @@ class Grouped extends AbstractType
|
|||
{
|
||||
$minPrices = [];
|
||||
|
||||
$result = $this->product->grouped_products()
|
||||
->join('product_flat', 'product_grouped_products.associated_product_id', '=', 'product_flat.product_id')
|
||||
->selectRaw('IF( product_flat.special_price_from IS NOT NULL
|
||||
AND product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= product_flat.special_price_from
|
||||
AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS min_price')
|
||||
->where('product_flat.channel', core()->getCurrentChannelCode())
|
||||
->where('product_flat.locale', app()->getLocale())
|
||||
->get();
|
||||
|
||||
foreach ($result as $price) {
|
||||
$minPrices[] = $price->min_price;
|
||||
foreach ($this->product->grouped_products as $groupOptionProduct) {
|
||||
$minPrices[] = $groupOptionProduct->associated_product->getTypeInstance()->getMinimalPrice();
|
||||
}
|
||||
|
||||
if (empty($minPrices))
|
||||
|
|
|
|||
Loading…
Reference in New Issue