<%IF $Shop.opt_document THEN
FETCH BrandDocument
IF $Numrows THEN%>
<%ENDIF
ENDFETCH
ENDIF%>
<%NEXTROW ENDQUERY%>
<%IF $brand_id THEN
QUERY Product(brand_id=$brand_id) PAGE $brand_pagenum PAGEROWS $Pagerows DO $brand_numpages=$Numpages $Data.Brand_numproducts=$Pagerows
DISPLAY
NEXTROW ENDQUERY
ENDIF
$xView='DEFAULT'
$xTransform='RS_THUMBS2'
%>
<%$prodvar_brand_id=$brand_id
$LINK = CALL GET_SEO_URL('brand', $brand_id, $seo_url)
$LINK = CALL SEO_URL_PREPARE_PARAMETER($LINK)
/* Filter */
IF $Shop.opt_filter AND $SHOW!="new" AND $SHOW!="campaign" AND $SHOW!="promote" THEN
QUERY BrandProductFilter(brand_id=$brand_id) DO
$no_of_filters=$Numrows
DISPLAY NEXTROW ENDQUERY
ENDIF
IF $Shop.opt_filter AND $no_of_filters THEN
INCLUDE 'rs/rs-filter-brand.htm'
ELSE
IF $Data.order=='DESC' THEN $rev_order='ASC' ELSE $rev_order='DESC' ENDIF
IF $opt_layout THEN
QUERY LayoutTemplate(template_type='product-small',available_in_shop=1,language=$language) DO
IF $Brand_numproducts AND ($product_display_sorting OR $LayoutTemplate.Numrows OR $show_numproduct_chooser) THEN%>
<%/* ProductVariant grabs parameters by itself, so we don't send any */
QUERY ProductVariant(orderby=$Data.orderby,order=$Data.order)
PAGE $Data.brand_pagenum PAGEROWS $Data.saved_pagerows
DO%>
<%DISPLAY
INCLUDE 'rs/rs-product-small.htm'
NEXTROW%>
<%IF $SHOW != 'puff' THEN INCLUDE 'rs/rs-pageselector-v2.htm' ENDIF
ENDQUERY%>
<%ENDIF /*IF IF $Shop.opt_filter...*/
ENDIF /*IF $brand_id...*/%>