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