@page_title[] $catalog[^oSql.table{SELECT id, name FROM mirr_season_catalog WHERE published='yes' }] ^if(def $catalog){ $contents[^oSql.table{ SELECT name FROM mirr_season_catalog_contents WHERE parent_id = $catalog.id AND (startpage = '^form:page.int(0)' OR startpage = ^eval(^form:page.int(0) -1) ) }] $result[$catalog.name $contents.name $now.year страницы ^form:page.int(0) - ^eval(^form:page.int(0) + 1)] } @description[] $catalog[^oSql.table{SELECT id, name FROM mirr_season_catalog WHERE published='yes' }] ^if(def $catalog){ $contents[^oSql.table{ SELECT name FROM mirr_season_catalog_contents WHERE parent_id = $catalog.id AND (startpage = '^form:page.int(0)' OR startpage = ^eval(^form:page.int(0) -1) ) }] $catalog.name $contents.name $now.year страницы ^form:page.int(0) - ^eval(^form:page.int(0) + 1) } @content[] $catalog[^oSql.table{SELECT id, name, season_id, year FROM mirr_season_catalog WHERE published='yes' }] ^if(def $catalog){ $contents[^oSql.table{ SELECT id, name, startpage FROM mirr_season_catalog_contents WHERE parent_id = '$catalog.id' }] $spreads[^oSql.table{SELECT first_page, second_page FROM mirr_season_catalog_spread WHERE catalog_id = '$catalog.id' }] ############# pager $max_page[^oSql.int{ SELECT second_page FROM mirr_season_catalog_spread WHERE catalog_id = '$catalog.id' ORDER BY second_page DESC }[$.limit(1) $.offset(0) $.default{0}]] ############# /pager ^if(^form:page.int(-1) > -1 ){ ^if(^form:page.int(0) > $max_page){ ^if(-f "/s_catalog/${catalog.id}_last_cover.jpg"){ $last_cover[^image::measure[/s_catalog/${catalog.id}_last_cover.jpg]]
^last_cover.html[ $.border[0] $.alt[Сезонный каталог mirra $catalog.name ] ]
} }{ $cur_spread[^oSql.table{SELECT id, first_page, second_page FROM mirr_season_catalog_spread WHERE catalog_id = '$catalog.id' AND ( second_page = '$form:page' OR first_page = '$form:page' ) }]
$left[^oSql.table{SELECT mirr_goods.id, mirr_goods.id as prod_id, parent_category, goods_name, capacity, unit, mirr_goods_unavailability.cause, mirr_goods_unavailability.region_id, v_lastprice.price FROM mirr_season_catalog_goods, mirr_goods LEFT JOIN mirr_goods_unavailability ON ( (mirr_goods_unavailability.product_id = mirr_goods.id AND mirr_goods_unavailability.region_id = '^user_region_id[]' ) OR mirr_goods_unavailability.region_id is NULL ) LEFT JOIN v_lastprice on ( v_lastprice.region_id = ^user_region_id[] AND v_lastprice.product_id = mirr_goods.id ) WHERE mirr_season_catalog_goods.prod_id = mirr_goods.id AND mirr_season_catalog_goods.parent_id = '$cur_spread.id' AND mirr_season_catalog_goods.side='left' }]
^left.menu{ $is_left_cat_on[^oSql.table{ SELECT mirr_goods.id, goods_name FROM mirr_goods, mirr_categories, mirr_catalog_availability WHERE mirr_goods.id = '$left.prod_id' AND mirr_goods.parent_category = mirr_categories.id AND ( mirr_categories.parent_catalog_id = mirr_catalog_availability.catalog_id AND mirr_catalog_availability.region_id = '^user_region_id[]' ) }] ^if(def $is_left_cat_on){ ^if($left.cause ne not_available){ - $left.goods_name $left.capacity $left.unit ^if_special_price($left.id){ ^currancy_declined[^local_price[$left.price]] ^currancy_declined[^local_price[^real_price[$left.id]]] }{ ^currancy_declined[^local_price[$left.price]] } ^to_basket[$left.id] ^special_offer[$left.id] } } }[
]  ^;
$right[^oSql.table{SELECT mirr_goods.id, mirr_goods.id as prod_id, parent_category, goods_name, capacity, unit, mirr_goods_unavailability.cause, mirr_goods_unavailability.region_id, v_lastprice.price FROM mirr_season_catalog_goods, mirr_goods LEFT JOIN mirr_goods_unavailability ON ( (mirr_goods_unavailability.product_id = mirr_goods.id AND mirr_goods_unavailability.region_id = '^user_region_id[]' ) OR mirr_goods_unavailability.region_id is NULL ) LEFT JOIN v_lastprice on ( v_lastprice.region_id = ^user_region_id[] AND v_lastprice.product_id = mirr_goods.id ) WHERE mirr_season_catalog_goods.prod_id = mirr_goods.id AND mirr_season_catalog_goods.parent_id = '$cur_spread.id' AND mirr_season_catalog_goods.side='right' }] ^right.menu{ $is_right_cat_on[^oSql.table{ SELECT mirr_goods.id, goods_name FROM mirr_goods, mirr_categories, mirr_catalog_availability WHERE mirr_goods.id = '$right.prod_id' AND mirr_goods.parent_category = mirr_categories.id AND ( mirr_categories.parent_catalog_id = mirr_catalog_availability.catalog_id AND mirr_catalog_availability.region_id = '^user_region_id[]' ) }] ^if(def $is_right_cat_on){ ^if($right.cause ne not_available){ - $right.goods_name $right.capacity $right.unit ^if_special_price($right.id){ ^currancy_declined[^local_price[$right.price]] ^currancy_declined[^local_price[^real_price[$right.id]]] }{ ^currancy_declined[^local_price[$right.price]] } ^to_basket[$right.id] ^special_offer[$right.id] } } }[
]  ^;
^if(-f "/s_catalog/${catalog.id}_${cur_spread.id}.jpg"){ $cur_spread_pic[^image::measure[/s_catalog/${catalog.id}_${cur_spread.id}.jpg]] ^cur_spread_pic.html[ $.border[0] $.alt[Сезонный каталог mirra $catalog.name страницы $cur_spread.first_page - $cur_spread.second_page] $.title[Сезонный каталог mirra $catalog.name страницы $cur_spread.first_page - $cur_spread.second_page] ] }
} }{ ^if(-f "/s_catalog/${catalog.id}_first_cover.jpg"){ $first_cover[^image::measure[/s_catalog/${catalog.id}_first_cover.jpg]]
^first_cover.html[ $.border[0] $.alt[Сезонный каталог mirra $catalog.name ] ]
} } }{ Сезонный каталог временно недоступен
Перейдите в магазин } @pager[] $catalog[^oSql.table{SELECT id, name, season_id, year FROM mirr_season_catalog WHERE published='yes' }] ^if(def $catalog){ $contents[^oSql.table{ SELECT id, name, startpage FROM mirr_season_catalog_contents WHERE parent_id = '$catalog.id' }] $spreads[^oSql.table{SELECT first_page, second_page FROM mirr_season_catalog_spread WHERE catalog_id = '$catalog.id' }] ############# pager $max_page[^oSql.int{ SELECT second_page FROM mirr_season_catalog_spread WHERE catalog_id = '$catalog.id' ORDER BY second_page DESC }[$.limit(1) $.offset(0) $.default{0}]] ############# /pager
^if(^form:page.int(-1) >= 0){ < }{ < }  ^; ^if(^form:page.int(0) < $max_page){ > }{ > }
}