public function actionMain() { //$products = new ProductsModel(); $labelprod = new ProductLabelModel(); $slabel_items = $labelprod->getLabelProducts(2, 6); $nlabel_items = $labelprod->getLabelProducts(1, 6); // Получаем данные для корзины $basket_ob = new BasketModel(); $basket = $basket_ob->getBasket(); // Создаем шаблон и передаем ему нужные переменные $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu())); $right_content = $this->template('/main/tpl_mainlabels.php', array('stitle' => 'Акции', 'ntitle' => 'Новинки', 'sitems' => $slabel_items, 'nitems' => $nlabel_items)); $tmp = $this->template('/main/tpl_main.php', array('title' => 'Онлайн-аптека в Англии с доставкой', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $basket[0], 'price' => $basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu)); echo $tmp; }
public function __call($n, $v) { $param = str_replace('action', '', $n); $param = str_replace('.html', '', $param); $article = new ArticleModel(); $article->sql_params = array('name' => 'alias', 'value' => $param); $item = $article->findAllParams()[1]; if (empty($item)) { die('Данный материал не доступен!'); } else { // Получаем данные для корзины $basket_ob = new BasketModel(); $basket = $basket_ob->getBasket(); $labelprod = new ProductLabelModel(); $slabel_items = $labelprod->getLabelProducts(2, 6); // Создаем шаблон и передаем ему нужные переменные $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu())); $sales_module = $this->template('/main/tpl_new_sales.php', array('stitle' => 'Акции', 'sitems' => $slabel_items)); $right_content = $this->template('/main/tpl_article.php', array('article' => $item[0], 'sales_module' => $sales_module)); $tmp = $this->template('/main/tpl_main.php', array('title' => 'Онлайн-аптека в Англии с доставкой', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $basket[0], 'price' => $basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu)); echo $tmp; } }
public function actionBasket() { // Получаем данные для корзины $basket = new BasketModel(); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $basket->submitBottons(); } else { } $baskt = $basket->showBasket(); $basket_itm = $baskt[0]; $shipping = $baskt[1]; $sm_basket = $basket->getBasket(); if ($basket_itm == null) { $labelprod = new ProductLabelModel(); $slabel_items = $labelprod->getLabelProducts(2, 9); $random_module = $this->template('/main/tpl_new_sales.php', array('stitle' => 'Не упустите выгодные предложения', 'sitems' => $slabel_items)); $right_content = $this->template('/main/tpl_basket_empty.php', array('basket' => $basket_itm, 'random_module' => $random_module)); // Создаем шаблон и передаем ему нужные переменные $left_content = $this->template('/main/tpl_left.php', array('categories' => $this->catmenu->showMenu())); $tmp = $this->template('/main/tpl_main.php', array('title' => 'Ваша корзина', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $sm_basket[0], 'price' => $sm_basket[1]), 'left_content' => $left_content, 'right_content' => $right_content, 'fmenu' => $this->footer_menu)); echo $tmp; } else { // Получаем данные для корзины $basket_ob = new BasketModel(); $payment = $basket_ob->getActivePayment(); $right_content = $this->template('/main/tpl_basket.php', array('basket' => $basket_itm, 'payment' => $payment, 'shipping' => $shipping)); $tmp = $this->template('/main/tpl_main_noleft.php', array('title' => 'Ваша корзина', 'top_menu' => $this->top_menu, 'basket' => array('quantity' => $sm_basket[0], 'price' => $sm_basket[1]), 'right_content' => $right_content, 'fmenu' => $this->footer_menu)); echo $tmp; } }