assign('aCategory', $aCategory); $aProduct = sql_getrow('SELECT p.*, pf.files_link FROM products p LEFT JOIN products_files pf USING (products_id) WHERE p.products_active = 1 AND p.products_id = ' . $iProductId . ' GROUP BY p.products_id'); $oDesign->assign('aProduct', $aProduct); $oDesign->assign('aProductImages', GetImages($aProduct['products_images'])); $oDesign->assign('aProductColors', GetColors($aProduct['products_colors'])); $oDesign->assign('aProductSizes', GetSizes($aProduct['products_sizes'])); $oDesign->assign('aProductPrices', GetPrices($aProduct['products_prices'])); $oDesign->assign('aProductPrices2', GetPrices($aProduct['products_prices2'])); $oDesign->assign('aProductPrices3', GetPrices($aProduct['products_prices3'])); $oDesign->assign('aProductPrices4', GetPrices($aProduct['products_prices4'])); $oDesign->assign('aWebColorNames', $aWebColorNames); $oDesign->SetTitle($aProduct['products_name']); $oDesign->ShowPage('shop/product.tpl'); } elseif ($iCategoryId != 0) { $aCategory = sql_getrow('SELECT categories_name,categories_order, categories_description, categories_keywords FROM products_categories WHERE categories_id = ' . $iCategoryId); $sCategoryName=$aCategory['categories_name']; $oPager = & new Pager(url_add_var(PHP_SELF, 'category_id=' . $iCategoryId)); $oPager->Query('SELECT * FROM products p WHERE p.products_active = 1 AND p.categories_id = ' . $iCategoryId . ' GROUP BY p.products_id ORDER BY p.products_order'); $oDesign->assign_by_ref('oPager', $oPager); $oDesign->assign('aCategory', $aCategory); $aPrev=sql_getrow('SELECT categories_id, categories_name FROM products_categories WHERE categories_active = 1 AND categories_order < ' . $aCategory['categories_order'] . ' ORDER BY categories_order DESC LIMIT 1'); $oDesign->assign('iPrev',intval($aPrev['categories_id'])); $oDesign->assign('iPrevName',$aPrev['categories_name']); $aNext=sql_getrow('SELECT categories_id, categories_name FROM products_categories WHERE categories_active = 1 AND categories_order > ' . $aCategory['categories_order'] . ' ORDER BY categories_order ASC LIMIT 1'); $oDesign->assign('iNext',intval($aNext['categories_id'])); $oDesign->assign('iNextName',$aNext['categories_name']); $oDesign->assign('iCatId',$iCategoryId); $oDesign->SetTitle($sCategoryName); $oDesign->ShowPage('shop/catalog.tpl'); } else { $oDesign->SetTitle('Shop Categories'); $oDesign->ShowPage('shop/index.tpl'); } ?>