%$saved_category_id = $category_id POP $category_id
IF $product_id OR $Request.extra_path THEN
$savedPagenum=$Pagenum
POP $Pagerows
POP $Pagenum
QUERY Product(state='ACTIVE', url_query=$Request.extra_path, product_id=$product_id) DO DISPLAY
$Data.found_a_product = 1
$Data.seo_url = $seo_url
$Data.product_id = $Product.product_id
IF $Shop.opt_product_last_viewed THEN
CALL ADD_PRODUCTVISITED($Product.product_id)
ENDIF
IF $seo_title THEN
$TITLE=$seo_title
ELSIF $Shop.seo_product_smarttitle_enable THEN
$TITLE = CALL EXEC($Shop.seo_product_smarttitle)
ELSE
$TITLE=$Product.Name
ENDIF
IF $seo_descr THEN
$META_DESCRIPTION=$seo_descr
ELSIF $Shop.seo_product_smartdescr_enable THEN
$META_DESCRIPTION = CALL EXEC( $Shop.seo_product_smartdescr )
ENDIF
IF $seo_keywords THEN $META_KEYWORDS=$seo_keywords ENDIF
INCLUDE 'canonical.htm'
IF $show_mobile AND $opt_mobile_shop THEN%>
<%ENDIF%>
<%
NEXTROW ENDQUERY ENDIF
IF NOT $Data.found_a_product THEN%>
<%ENDIF%>