SELECT
netting_promotions.*,
netting_promotion_descriptions.name,
netting_promotion_descriptions.detailed_description,
netting_promotion_descriptions.short_description
FROM
netting_promotions
LEFT JOIN netting_promotion_descriptions ON netting_promotion_descriptions.promotion_id = netting_promotions.promotion_id
AND netting_promotion_descriptions.lang_code = 'en'
LEFT JOIN netting_storefronts_promotions AS storefronts_promotions ON storefronts_promotions.promotion_id = netting_promotions.promotion_id
WHERE
1
AND IF(
from_date, from_date <= 1743825514,
1
)
AND IF(to_date, to_date >= 1743825514, 1)
AND status IN ('A', 'H')
AND netting_promotions.zone = 'catalog'
AND (
storefronts_promotions.storefront_id = 1
OR storefronts_promotions.storefront_id IS NULL
)
AND 1
ORDER BY
netting_promotions.stop_other_rules desc,
netting_promotions.priority asc