/**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     header('HTTP/1.1 404 Not Found');
     header('Status: 404 Not Found');
     parent::initContent();
     $this->setTemplate(_PS_THEME_DIR_ . '404.tpl');
 }
 public function initContent()
 {
     //pass data to template file
     $this->setTemplate(_PS_THEME_DIR_ . 'remboursementDon.tpl');
     //call parent initcontent - this is for loading the site's default header, footer, left and right columns
     parent::initContent();
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->addJS(_THEME_JS_DIR_ . 'index.js');
     $this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'), 'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'), 'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')));
     $this->setTemplate(_PS_THEME_DIR_ . 'index.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     header('HTTP/1.1 404 Not Found');
     header('Status: 404 Not Found');
     if (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('png', 'jpg', 'gif'))) {
         $this->context->cookie->disallowWriting();
         if ((bool) Configuration::get('PS_REWRITING_SETTINGS')) {
             preg_match('#([0-9]+)(\\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/(.+)\\.(png|jpg|gif)$#', $_SERVER['REQUEST_URI'], $matches);
         }
         if ((!isset($matches[2]) || empty($matches[2])) && !(bool) Configuration::get('PS_REWRITING_SETTINGS')) {
             preg_match('#/([0-9]+)(\\-[_a-zA-Z]*)\\.(png|jpg|gif)$#', $_SERVER['REQUEST_URI'], $matches);
         }
         if (is_array($matches) && !empty($matches[2]) && Tools::strtolower(substr($matches[2], -8)) != '_default' && is_numeric($matches[1])) {
             $matches[2] = substr($matches[2], 1, Tools::strlen($matches[2])) . '_default';
             if (!isset($matches[4])) {
                 $matches[4] = '';
             }
             header('Location: ' . $this->context->link->getImageLink($matches[4], $matches[1], $matches[2]), true, 302);
             exit;
         }
         header('Content-Type: image/gif');
         readfile(_PS_IMG_DIR_ . '404.gif');
         exit;
     } elseif (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('.js', 'css'))) {
         $this->context->cookie->disallowWriting();
         exit;
     }
     parent::initContent();
     $this->setTemplate(_PS_THEME_DIR_ . '404.tpl');
 }
Example #5
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->addJS(_THEME_JS_DIR_ . 'index.js');
     $this->addJS(_THEME_JS_DIR_ . 'modernizr.custom.js');
     $this->addJS(_THEME_JS_DIR_ . 'toucheffects.js');
     $this->addJS(_THEME_JS_DIR_ . 'supplier_list.js');
     $this->addJS(_THEME_JS_DIR_ . 'jquery.bxslider.js');
     $this->addJS(_THEME_JS_DIR_ . 'header.js');
     $this->addJS(_THEME_JS_DIR_ . 'waypoints.min.js');
     $this->addJS(_THEME_JS_DIR_ . 'jquery.counterup.min.js');
     $this->addJS(_THEME_JS_DIR_ . 'front.js');
     $supplier = new SupplierControllerCore();
     if ($idCategory == null) {
         $supplier->initContent($this->idCategory);
     } else {
         $supplier->initContent($this->idCategory);
     }
     /**
      * get categories level 2 for present them in header
      **/
     $categories = Category::getChildrenWithNbSelectedSubCat(2, '', true, null, true);
     $this->context->smarty->assign(array('categories' => $categories));
     $this->assignKPI();
     /*$this->context->smarty->assign(array('HOOK_HOME' => Hook::exec('displayHome'),
           'HOOK_HOME_TAB' => Hook::exec('displayHomeTab'),
           'HOOK_HOME_TAB_CONTENT' => Hook::exec('displayHomeTabContent')
       ));*/
     $this->setTemplate(_PS_THEME_DIR_ . 'index.tpl');
 }
Example #6
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign('about_shop_cart', true);
     //print_r($_POST);
     //print '<br><br>';
     //print_r($this->errors);
     $this->context->smarty->assign('genders', Gender::getGenders());
     $this->assignDate();
     $this->assignCountries();
     $this->context->smarty->assign('newsletter', 1);
     $back = Tools::getValue('back');
     $key = Tools::safeOutput(Tools::getValue('key'));
     if (!empty($key)) {
         $back .= (strpos($back, '?') !== false ? '&' : '?') . 'key=' . $key;
     }
     if ($back == Tools::secureReferrer(Tools::getValue('back'))) {
         $this->context->smarty->assign('back', html_entity_decode($back));
     } else {
         $this->context->smarty->assign('back', Tools::safeOutput($back));
     }
     if (Tools::getValue('display_guest_checkout')) {
         if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
             $countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
         } else {
             $countries = Country::getCountries($this->context->language->id, true);
         }
         if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
             // get all countries as language (xy) or language-country (wz-XY)
             $array = array();
             preg_match("#(?<=-)\\w\\w|\\w\\w(?!-)#", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $array);
             if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0]))) {
                 $sl_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
             }
         } else {
             $sl_country = (int) Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
         }
         $this->context->smarty->assign(array('inOrderProcess' => true, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'sl_country' => (int) $sl_country, 'countries' => $countries));
     }
     if (Tools::getValue('create_account')) {
         $this->context->smarty->assign('email_create', 1);
     }
     if (Tools::getValue('multi-shipping') == 1) {
         $this->context->smarty->assign('multi_shipping', true);
     } else {
         $this->context->smarty->assign('multi_shipping', false);
     }
     $this->assignAddressFormat();
     // Call a hook to display more information on form
     $this->context->smarty->assign(array('HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
     // Just set $this->template value here in case it's used by Ajax
     $this->setTemplate(_PS_THEME_DIR_ . 'authentication.tpl');
     if ($this->ajax) {
         // Call a hook to display more information on form
         $this->context->smarty->assign(array('PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'genders' => Gender::getGenders(), 'ajax_isset' => 1));
         $return = array('hasError' => !empty($this->errors), 'errors' => $this->errors, 'page' => $this->context->smarty->fetch($this->template), 'token' => Tools::getToken(false));
         die(Tools::jsonEncode($return));
     }
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $has_address = $this->context->customer->getAddresses($this->context->language->id);
     $this->context->smarty->assign(array('has_customer_an_address' => empty($has_address), 'voucherAllowed' => (int) CartRule::isFeatureActive(), 'returnAllowed' => (int) Configuration::get('PS_ORDER_RETURN')));
     $this->context->smarty->assign('HOOK_CUSTOMER_ACCOUNT', Hook::exec('displayCustomerAccount'));
     $this->setTemplate(_PS_THEME_DIR_ . 'my-account.tpl');
 }
 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $this->setTemplate('customer/order-return');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false);
     $nb_cart_rules = count($cart_rules);
     $this->context->smarty->assign(array('nb_cart_rules' => (int) $nb_cart_rules, 'cart_rules' => $cart_rules));
     $this->setTemplate(_PS_THEME_DIR_ . 'discount.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = Product::getPricesDrop($this->context->language->id, null, null, true);
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => Product::getPricesDrop($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'prices-drop.tpl');
 }
Example #11
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     if (count($this->context->customer->getSimpleAddresses()) <= 0) {
         $link = '<a href="' . $this->context->link->getPageLink('address', true) . '">' . $this->trans('Add a new address', array(), 'Shop.Theme.Actions') . '</a>';
         $this->warning[] = $this->trans('No addresses are available. %s', array($link), 'Shop.Notifications.Success');
     }
     $this->setTemplate('customer/addresses');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = (int) Product::getNewProducts($this->context->language->id, isset($this->p) ? (int) $this->p - 1 : null, isset($this->n) ? (int) $this->n : null, true);
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => Product::getNewProducts($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => (int) $nbProducts, 'homeSize' => Image::getSize('home_default'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'new-products.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     $original_query = Tools::getValue('q');
     $query = Tools::replaceAccentedChars(urldecode($original_query));
     if ($this->ajax_search) {
         $searchResults = Search::find((int) Tools::getValue('id_lang'), $query, 1, 10, 'position', 'desc', true);
         if (is_array($searchResults)) {
             foreach ($searchResults as &$product) {
                 $product['product_link'] = $this->context->link->getProductLink($product['id_product'], $product['prewrite'], $product['crewrite']);
             }
             Hook::exec('actionSearch', array('expr' => $query, 'total' => count($searchResults)));
         }
         $this->ajaxDie(Tools::jsonEncode($searchResults));
     }
     //Only controller content initialization when the user use the normal search
     parent::initContent();
     $product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int) $this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE');
     if ($this->instant_search && !is_array($query)) {
         $this->productSort();
         $this->n = abs((int) Tools::getValue('n', $product_per_page));
         $this->p = abs((int) Tools::getValue('p', 1));
         $search = Search::find($this->context->language->id, $query, 1, 10, 'position', 'desc');
         Hook::exec('actionSearch', array('expr' => $query, 'total' => $search['total']));
         $nbProducts = $search['total'];
         $this->pagination($nbProducts);
         $this->addColorsToProductList($search['result']);
         $this->context->smarty->assign(array('products' => $search['result'], 'search_products' => $search['result'], 'nbProducts' => $search['total'], 'search_query' => $original_query, 'instant_search' => $this->instant_search, 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
     } elseif (($query = Tools::getValue('search_query', Tools::getValue('ref'))) && !is_array($query)) {
         $this->productSort();
         $this->n = abs((int) Tools::getValue('n', $product_per_page));
         $this->p = abs((int) Tools::getValue('p', 1));
         $original_query = $query;
         $query = Tools::replaceAccentedChars(urldecode($query));
         $search = Search::find($this->context->language->id, $query, $this->p, $this->n, $this->orderBy, $this->orderWay);
         if (is_array($search['result'])) {
             foreach ($search['result'] as &$product) {
                 $product['link'] .= (strpos($product['link'], '?') === false ? '?' : '&') . 'search_query=' . urlencode($query) . '&results=' . (int) $search['total'];
             }
         }
         Hook::exec('actionSearch', array('expr' => $query, 'total' => $search['total']));
         $nbProducts = $search['total'];
         $this->pagination($nbProducts);
         $this->addColorsToProductList($search['result']);
         $this->context->smarty->assign(array('products' => $search['result'], 'search_products' => $search['result'], 'nbProducts' => $search['total'], 'search_query' => $original_query, 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
     } elseif (($tag = urldecode(Tools::getValue('tag'))) && !is_array($tag)) {
         $nbProducts = (int) Search::searchTag($this->context->language->id, $tag, true);
         $this->pagination($nbProducts);
         $result = Search::searchTag($this->context->language->id, $tag, false, $this->p, $this->n, $this->orderBy, $this->orderWay);
         Hook::exec('actionSearch', array('expr' => $tag, 'total' => count($result)));
         $this->addColorsToProductList($result);
         $this->context->smarty->assign(array('search_tag' => $tag, 'products' => $result, 'search_products' => $result, 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home'))));
     } else {
         $this->context->smarty->assign(array('products' => array(), 'search_products' => array(), 'pages_nb' => 1, 'nbProducts' => 0));
     }
     $this->context->smarty->assign(array('add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'search.tpl');
 }
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     $nbProducts = (int) ProductSale::getNbSales();
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize('home_default'), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
 }
Example #15
0
 public function initContent()
 {
     $this->association = Association::getAssociationById($this->idAssociation);
     $this->context->smarty->assign(array('association' => $this->association[0]));
     //pass data to template file
     $this->setTemplate(_PS_THEME_DIR_ . 'association.tpl');
     //call parent initcontent - this is for loading the site's default header, footer, left and right columns
     parent::initContent();
 }
 public function initContent()
 {
     // $this->productSort();
     // $nbProducts = (int)(Product::getTransitProducts((int)(self::$cookie->id_lang), isset($this->p) ? (int)($this->p) - 1 : NULL, isset($this->n) ? (int)($this->n) : NULL, true));
     //$this->pagination($nbProducts);
     $products = Product::getTransitProducts((int) $this->context->cookie->id_lang, isset($this->p) ? (int) $this->p - 1 : NULL, isset($this->n) ? (int) $this->n : NULL, false, $this->orderBy, $this->orderWay);
     $this->context->smarty->assign(array('HOOK_LEFT_COLUMN' => Hook::exec('displayLeftColumn'), 'products' => $products, 'path' => "Товар в пути"));
     parent::initContent();
     $this->setTemplate(_PS_THEME_DIR_ . 'transit.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign(array('is_guest' => $this->context->customer->is_guest, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()));
     if ($this->context->customer->is_guest) {
         $this->context->smarty->assign(array('id_order' => $this->id_order, 'reference_order' => $this->reference, 'id_order_formatted' => sprintf('#%06d', $this->id_order), 'email' => $this->context->customer->email));
         /* If guest we clear the cookie for security reason */
         $this->context->customer->mylogout();
     }
     $this->setTemplate(_PS_THEME_DIR_ . 'order-confirmation.tpl');
 }
Example #18
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false);
     $nb_cart_rules = count($cart_rules);
     foreach ($cart_rules as &$discount) {
         $discount['value'] = Tools::convertPriceFull($discount['value'], new Currency((int) $discount['reduction_currency']), new Currency((int) $this->context->cart->id_currency));
     }
     $this->context->smarty->assign(array('nb_cart_rules' => (int) $nb_cart_rules, 'cart_rules' => $cart_rules, 'discount' => $cart_rules, 'nbDiscounts' => (int) $nb_cart_rules));
     $this->setTemplate(_PS_THEME_DIR_ . 'discount.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     if (Validate::isLoadedObject($this->manufacturer) && $this->manufacturer->active && $this->manufacturer->isAssociatedToShop()) {
         $this->productSort();
         $this->assignOne();
         $this->setTemplate(_PS_THEME_DIR_ . 'manufacturer.tpl');
     } else {
         $this->assignAll();
         $this->setTemplate(_PS_THEME_DIR_ . 'manufacturer-list.tpl');
     }
 }
Example #20
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $cart_rules = $this->getTemplateVarCartRules();
     if (count($cart_rules) <= 0) {
         $this->warning[] = $this->trans('You do not have any vouchers.', array(), 'Shop.Notifications.Warning');
     }
     $this->context->smarty->assign(['cart_rules' => $cart_rules]);
     $this->setTemplate('customer/discount');
 }
Example #21
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $credit_slips = $this->getTemplateVarCreditSlips();
     if (count($credit_slips) <= 0) {
         $this->warning[] = $this->trans('You have not received any credit slips.', array(), 'Shop.Notifications.Warning');
     }
     $this->context->smarty->assign(['credit_slips' => $credit_slips]);
     $this->setTemplate('customer/order-slip');
 }
Example #22
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     if (Validate::isLoadedObject($this->supplier) && $this->supplier->active && $this->supplier->isAssociatedToShop()) {
         $this->productSort();
         // productSort must be called before assignOne
         $this->assignOne();
         $this->setTemplate(_PS_THEME_DIR_ . 'supplier.tpl');
     } else {
         $this->assignAll();
         $this->setTemplate(_PS_THEME_DIR_ . 'supplier-list.tpl');
     }
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     if ($orders = Order::getCustomerOrders($this->context->customer->id)) {
         foreach ($orders as &$order) {
             $myOrder = new Order((int) $order['id_order']);
             if (Validate::isLoadedObject($myOrder)) {
                 $order['virtual'] = $myOrder->isVirtual(false);
             }
         }
     }
     $this->context->smarty->assign(array('orders' => $orders, 'invoiceAllowed' => (int) Configuration::get('PS_INVOICE'), 'reorderingAllowed' => !(int) Configuration::get('PS_DISALLOW_HISTORY_REORDERING'), 'slowValidation' => Tools::isSubmit('slowvalidation')));
     $this->setTemplate(_PS_THEME_DIR_ . 'history.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->productSort();
     // Override default configuration values: cause the new products page must display latest products first.
     if (!Tools::getIsset('orderway') || !Tools::getIsset('orderby')) {
         $this->orderBy = 'date_add';
         $this->orderWay = 'DESC';
     }
     $nbProducts = (int) Product::getNewProducts($this->context->language->id, isset($this->p) ? (int) $this->p - 1 : null, isset($this->n) ? (int) $this->n : null, true);
     $this->pagination($nbProducts);
     $this->context->smarty->assign(array('products' => Product::getNewProducts($this->context->language->id, (int) $this->p - 1, (int) $this->n, false, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => (int) $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
     $this->setTemplate(_PS_THEME_DIR_ . 'new-products.tpl');
 }
Example #25
0
 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     if ($this->assignCase == 1) {
         $this->context->smarty->assign(array('cms' => $this->objectPresenter->present($this->cms)));
         if ($this->cms->indexation == 0) {
             $this->context->smarty->assign('nobots', true);
         }
         $this->setTemplate('cms/page', array('entity' => 'cms', 'id' => $this->cms->id));
     } elseif ($this->assignCase == 2) {
         $this->context->smarty->assign($this->getTemplateVarCategoryCms());
         $this->setTemplate('cms/category');
     }
 }
Example #26
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign('categoriesTree', Category::getRootCategory()->recurseLiteCategTree(0));
     $this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1));
     $this->context->smarty->assign('voucherAllowed', (int) Configuration::get('PS_VOUCHERS'));
     $blockmanufacturer = Module::getInstanceByName('blockmanufacturer');
     $blocksupplier = Module::getInstanceByName('blocksupplier');
     $this->context->smarty->assign('display_manufacturer_link', (bool) $blockmanufacturer->active);
     $this->context->smarty->assign('display_supplier_link', (bool) $blocksupplier->active);
     $this->context->smarty->assign('PS_DISPLAY_SUPPLIERS', Configuration::get('PS_DISPLAY_SUPPLIERS'));
     $this->context->smarty->assign('display_store', Configuration::get('PS_STORES_DISPLAY_SITEMAP'));
     $this->setTemplate(_PS_THEME_DIR_ . 'sitemap.tpl');
 }
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     header('HTTP/1.1 404 Not Found');
     header('Status: 404 Not Found');
     if (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('png', 'jpg', 'gif'))) {
         header('Content-Type: image/gif');
         readfile(_PS_IMG_DIR_ . '404.gif');
         exit;
     } elseif (in_array(Tools::strtolower(substr($_SERVER['REQUEST_URI'], -3)), array('.js', 'css'))) {
         exit;
     }
     parent::initContent();
     $this->setTemplate(_PS_THEME_DIR_ . '404.tpl');
 }
 public function initContent()
 {
     if (Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         parent::initContent();
         $this->productSort();
         $nbProducts = (int) ProductSale::getNbSales();
         $this->pagination($nbProducts);
         $products = ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay);
         $this->addColorsToProductList($products);
         $this->context->smarty->assign(array('products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM')));
         $this->setTemplate(_PS_THEME_DIR_ . 'best-sales.tpl');
     } else {
         Tools::redirect('index.php?controller=404');
     }
 }
Example #29
0
 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $this->context->smarty->assign('genders', Gender::getGenders());
     $this->assignDate();
     $this->assignCountries();
     $newsletter = Configuration::get('PS_CUSTOMER_NWSL') || Module::isInstalled('blocknewsletter') && Module::getInstanceByName('blocknewsletter')->active;
     $this->context->smarty->assign('newsletter', $newsletter);
     $this->context->smarty->assign('optin', (bool) Configuration::get('PS_CUSTOMER_OPTIN'));
     $back = Tools::getValue('back');
     $key = Tools::safeOutput(Tools::getValue('key'));
     if (!empty($key)) {
         $back .= (strpos($back, '?') !== false ? '&' : '?') . 'key=' . $key;
     }
     if ($back == Tools::secureReferrer(Tools::getValue('back'))) {
         $this->context->smarty->assign('back', html_entity_decode($back));
     } else {
         $this->context->smarty->assign('back', Tools::safeOutput($back));
     }
     if (Tools::getValue('display_guest_checkout')) {
         if (Configuration::get('PS_RESTRICT_DELIVERED_COUNTRIES')) {
             $countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
         } else {
             $countries = Country::getCountries($this->context->language->id, true);
         }
         $this->context->smarty->assign(array('inOrderProcess' => true, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'sl_country' => (int) $this->id_country, 'countries' => $countries));
     }
     if (Tools::getValue('create_account')) {
         $this->context->smarty->assign('email_create', 1);
     }
     if (Tools::getValue('multi-shipping') == 1) {
         $this->context->smarty->assign('multi_shipping', true);
     } else {
         $this->context->smarty->assign('multi_shipping', false);
     }
     $this->context->smarty->assign('field_required', $this->context->customer->validateFieldsRequiredDatabase());
     $this->assignAddressFormat();
     // Call a hook to display more information on form
     $this->context->smarty->assign(array('HOOK_CREATE_ACCOUNT_FORM' => Hook::exec('displayCustomerAccountForm'), 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop')));
     // Just set $this->template value here in case it's used by Ajax
     $this->setTemplate(_PS_THEME_DIR_ . 'authentication.tpl');
     if ($this->ajax) {
         // Call a hook to display more information on form
         $this->context->smarty->assign(array('PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), 'genders' => Gender::getGenders()));
         $return = array('hasError' => !empty($this->errors), 'errors' => $this->errors, 'page' => $this->context->smarty->fetch($this->template), 'token' => Tools::getToken(false));
         $this->ajaxDie(Tools::jsonEncode($return));
     }
 }
Example #30
0
 public function initContent()
 {
     parent::initContent();
     if (isset($this->context->cookie->id_compare)) {
         $this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) $this->context->cookie->id_compare));
     }
     $this->productSort();
     // Product sort must be called before assignProductList()
     $this->assignScenes();
     $this->assignSubcategories();
     if ($this->category->id != 1) {
         $this->assignProductList();
     }
     $this->context->smarty->assign(array('category' => $this->category, 'products' => isset($this->cat_products) && $this->cat_products ? $this->cat_products : null, 'id_category' => (int) $this->category->id, 'id_category_parent' => (int) $this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath($this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize('category'), 'mediumSize' => Image::getSize('medium'), 'thumbSceneSize' => Image::getSize('thumb_scene'), 'homeSize' => Image::getSize('home'), 'allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers()));
     $this->setTemplate(_PS_THEME_DIR_ . 'category.tpl');
 }