<?php require_once 'init.php'; require_once cf\Config::path . 'api/shop.php'; $page = cf\api\page\get('products'); $smarty->assign('pageId', $page['id']); $smarty->assign('pageText', cf\api\page\getText($page['id'])); $categories = cf\api\shop\getCategoriesTree(); $smarty->assign('categories', $categories); $products = array(); foreach ($categories as $cat) { $products[$cat['id']] = cf\api\shop\getProducts($cat['id']); foreach ($products[$cat['id']] as &$product) { $info = cf\api\shop\getProduct($product[0]); $product['attributes'] = $info['attributes']; } } $smarty->assign('products', $products); $smarty->assign('reviews', cf\query2arrays("SELECT author, review FROM reviews ORDER BY sort_order LIMIT 4")); show('products', $page['name'], array(), $page['title'], $page['keywords'], $page['descr']);
<?php require_once 'init.php'; require_once cf\Config::path . 'api/shop.php'; $page = cf\api\page\get('map'); if (!$page) { $page = cf\api\page\get('error'); } $smarty->assign('pageText', cf\api\page\getText($page['id'])); $smarty->assign('pageId', $page['id']); $smarty->assign('articles', cf\api\page\getTree('articles', false, 1, '/articles')); $smarty->assign('categories', cf\api\shop\getCategoriesTree()); show('map', $page['name'], $crumbs, $page['title'], $page['keywords'], $page['descr']);