Example #1
0
 public function index()
 {
     if (!$this->customer->isLogged()) {
         $this->session->data['redirect'] = $this->url->link('account/return', '', 'SSL');
         $this->response->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $this->load->language('account/return');
     $this->document->setTitle($this->language->get('heading_title'));
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'));
     $url = '';
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/return', $url, 'SSL'));
     $data['heading_title'] = $this->language->get('heading_title');
     $data['text_empty'] = $this->language->get('text_empty');
     $data['column_return_id'] = $this->language->get('column_return_id');
     $data['column_order_id'] = $this->language->get('column_order_id');
     $data['column_status'] = $this->language->get('column_status');
     $data['column_date_added'] = $this->language->get('column_date_added');
     $data['column_customer'] = $this->language->get('column_customer');
     $data['button_view'] = $this->language->get('button_view');
     $data['button_continue'] = $this->language->get('button_continue');
     $this->load->model('account/return');
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     $data['returns'] = array();
     $return_total = $this->model_account_return->getTotalReturns();
     $results = $this->model_account_return->getReturns(($page - 1) * 10, 10);
     foreach ($results as $result) {
         $data['returns'][] = array('return_id' => $result['return_id'], 'order_id' => $result['order_id'], 'name' => $result['firstname'] . ' ' . $result['lastname'], 'status' => $result['status'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'href' => $this->url->link('account/return/info', 'return_id=' . $result['return_id'] . $url, 'SSL'));
     }
     $pagination = new Pagination();
     $pagination->total = $return_total;
     $pagination->page = $page;
     $pagination->limit = $this->config->get('config_product_limit');
     $pagination->url = $this->url->link('account/return', 'page={page}', 'SSL');
     $data['pagination'] = $pagination->render();
     $this->document->setPagePrev($pagination->getPagePrev());
     $this->document->setPageNext($pagination->getPageNext());
     $data['results'] = sprintf($this->language->get('text_pagination'), $return_total ? ($page - 1) * $this->config->get('config_product_limit') + 1 : 0, ($page - 1) * $this->config->get('config_product_limit') > $return_total - $this->config->get('config_product_limit') ? $return_total : ($page - 1) * $this->config->get('config_product_limit') + $this->config->get('config_product_limit'), $return_total, ceil($return_total / $this->config->get('config_product_limit')));
     $data['continue'] = $this->url->link('account/account', '', 'SSL');
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/return_list.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/return_list.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/account/return_list.tpl', $data));
     }
 }
 public function index()
 {
     if (!$this->customer->isLogged()) {
         $this->session->data['redirect'] = $this->url->link('account/transaction', '', 'SSL');
         $this->response->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $this->load->language('account/transaction');
     $this->document->setTitle($this->language->get('heading_title'));
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_transaction'), 'href' => $this->url->link('account/transaction', '', 'SSL'));
     $this->load->model('account/transaction');
     $data['heading_title'] = $this->language->get('heading_title');
     $data['column_date_added'] = $this->language->get('column_date_added');
     $data['column_description'] = $this->language->get('column_description');
     $data['column_amount'] = sprintf($this->language->get('column_amount'), $this->config->get('config_currency'));
     $data['text_total'] = $this->language->get('text_total');
     $data['text_empty'] = $this->language->get('text_empty');
     $data['button_continue'] = $this->language->get('button_continue');
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     $data['transactions'] = array();
     $filter_data = array('sort' => 'date_added', 'order' => 'DESC', 'start' => ($page - 1) * 10, 'limit' => 10);
     $transaction_total = $this->model_account_transaction->getTotalTransactions();
     $results = $this->model_account_transaction->getTransactions($filter_data);
     foreach ($results as $result) {
         $data['transactions'][] = array('amount' => $this->currency->format($result['amount'], $this->config->get('config_currency')), 'description' => $result['description'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])));
     }
     $pagination = new Pagination();
     $pagination->total = $transaction_total;
     $pagination->page = $page;
     $pagination->limit = 10;
     $pagination->url = $this->url->link('account/transaction', 'page={page}', 'SSL');
     $data['pagination'] = $pagination->render();
     $this->document->setPagePrev($pagination->getPagePrev());
     $this->document->setPageNext($pagination->getPageNext());
     $data['results'] = sprintf($this->language->get('text_pagination'), $transaction_total ? ($page - 1) * 10 + 1 : 0, ($page - 1) * 10 > $transaction_total - 10 ? $transaction_total : ($page - 1) * 10 + 10, $transaction_total, ceil($transaction_total / 10));
     $data['total'] = $this->currency->format($this->customer->getBalance());
     $data['continue'] = $this->url->link('account/account', '', 'SSL');
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/transaction.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/transaction.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/account/transaction.tpl', $data));
     }
 }
Example #3
0
 public function index()
 {
     $this->load->language('product/special');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     if (isset($this->request->get['sort'])) {
         $sort = $this->request->get['sort'];
     } else {
         $sort = $this->config->get('config_options_sort_order');
     }
     if (isset($this->request->get['order'])) {
         $order = $this->request->get['order'];
     } else {
         $order = $this->config->get('config_options_type_sort_order');
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     if (isset($this->request->get['limit'])) {
         $limit = $this->request->get['limit'];
     } else {
         $limit = $this->config->get('config_product_limit');
     }
     $this->document->setTitle($this->language->get('heading_title'));
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $url = '';
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     if (isset($this->request->get['limit'])) {
         $url .= '&limit=' . $this->request->get['limit'];
     }
     $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('product/special', $url));
     $data['heading_title'] = $this->language->get('heading_title');
     $data['text_empty'] = $this->language->get('text_empty');
     $data['text_quantity'] = $this->language->get('text_quantity');
     $data['text_manufacturer'] = $this->language->get('text_manufacturer');
     $data['text_model'] = $this->language->get('text_model');
     $data['text_price'] = $this->language->get('text_price');
     $data['text_tax'] = $this->language->get('text_tax');
     $data['text_points'] = $this->language->get('text_points');
     $data['text_compare'] = sprintf($this->language->get('text_compare'), isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0);
     $data['text_sort'] = $this->language->get('text_sort');
     $data['text_limit'] = $this->language->get('text_limit');
     $data['button_cart'] = $this->language->get('button_cart');
     $data['button_wishlist'] = $this->language->get('button_wishlist');
     $data['button_compare'] = $this->language->get('button_compare');
     $data['button_list'] = $this->language->get('button_list');
     $data['button_grid'] = $this->language->get('button_grid');
     $data['button_continue'] = $this->language->get('button_continue');
     $data['compare'] = $this->url->link('product/compare');
     $prods = array();
     $filter_data = array('sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit);
     $product_total = $this->model_catalog_product->getTotalProductSpecials();
     $results = $this->model_catalog_product->getProductSpecials($filter_data);
     $column_left = $this->load->controller('common/column_left');
     $params['products'] = $results;
     $params['list'] = true;
     if ($column_left) {
         $params['qtd_column'] = 3;
     } else {
         $params['qtd_column'] = 4;
     }
     $data['products'] = $this->load->controller('product/product_built_list', $params);
     $url = '';
     if (isset($this->request->get['limit'])) {
         $url .= '&limit=' . $this->request->get['limit'];
     }
     $data['sorts'] = array();
     $data['sorts'][] = array('text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/special', 'sort=p.sort_order&order=ASC' . $url));
     $data['sorts'][] = array('text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/special', 'sort=pd.name&order=ASC' . $url));
     $data['sorts'][] = array('text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/special', 'sort=pd.name&order=DESC' . $url));
     $data['sorts'][] = array('text' => $this->language->get('text_price_asc'), 'value' => 'ps.price-ASC', 'href' => $this->url->link('product/special', 'sort=ps.price&order=ASC' . $url));
     $data['sorts'][] = array('text' => $this->language->get('text_price_desc'), 'value' => 'ps.price-DESC', 'href' => $this->url->link('product/special', 'sort=ps.price&order=DESC' . $url));
     if ($this->config->get('config_review_status')) {
         $data['sorts'][] = array('text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/special', 'sort=rating&order=DESC' . $url));
         $data['sorts'][] = array('text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/special', 'sort=rating&order=ASC' . $url));
     }
     $data['sorts'][] = array('text' => $this->language->get('text_model_asc'), 'value' => 'p.model-ASC', 'href' => $this->url->link('product/special', 'sort=p.model&order=ASC' . $url));
     $data['sorts'][] = array('text' => $this->language->get('text_model_desc'), 'value' => 'p.model-DESC', 'href' => $this->url->link('product/special', 'sort=p.model&order=DESC' . $url));
     $url = '';
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     $data['limits'] = array();
     $limits = array_unique(array($this->config->get('config_product_limit'), 24, 48, 76, 100));
     sort($limits);
     foreach ($limits as $value) {
         $data['limits'][] = array('text' => $value, 'value' => $value, 'href' => $this->url->link('product/special', $url . '&limit=' . $value));
     }
     $url = '';
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['limit'])) {
         $url .= '&limit=' . $this->request->get['limit'];
     }
     $pagination = new Pagination();
     $pagination->total = $product_total;
     $pagination->page = $page;
     $pagination->limit = $limit;
     $pagination->url = $this->url->link('product/special', $url . '&page={page}');
     $data['pagination'] = $pagination->render();
     $this->document->setPagePrev($pagination->getPagePrev());
     $this->document->setPageNext($pagination->getPageNext());
     $data['results'] = sprintf($this->language->get('text_pagination'), $product_total ? ($page - 1) * $limit + 1 : 0, ($page - 1) * $limit > $product_total - $limit ? $product_total : ($page - 1) * $limit + $limit, $product_total, ceil($product_total / $limit));
     $data['sort'] = $sort;
     $data['order'] = $order;
     $data['limit'] = $limit;
     $data['continue'] = $this->url->link('common/home');
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/special.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/special.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/product/special.tpl', $data));
     }
 }
Example #4
0
 public function index()
 {
     $this->document->setPage('category');
     $this->load->language('product/category');
     $this->load->model('catalog/category');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     $this->load->model('extension/module');
     $filter_modules = $this->model_extension_module->getModuleByCode('filter_option');
     if (isset($this->request->get['filter'])) {
         $filter = $this->request->get['filter'];
     } else {
         $filter = '';
     }
     if (isset($this->request->get['price'])) {
         $price = str_replace('%', '', str_replace('=', '', $this->request->get['price']));
     } else {
         $price = '';
     }
     $filter_options = array();
     foreach ($filter_modules as $filter_module) {
         $setting_option = unserialize($filter_module['setting']);
         if (isset($this->request->get[$setting_option['param']])) {
             ${$setting_option}['param'] = str_replace('%', '', str_replace('=', '', $this->request->get[$setting_option['param']]));
             $filter_options[] = array('filter_' . $setting_option['param'] => ${$setting_option}['param']);
         } else {
             ${$setting_option}['param'] = '';
         }
     }
     if (isset($this->request->get['sort'])) {
         $sort = $this->request->get['sort'];
     } else {
         $sort = $this->config->get('config_options_sort_order');
     }
     if (isset($this->request->get['order'])) {
         $order = $this->request->get['order'];
     } else {
         $order = $this->config->get('config_options_type_sort_order');
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     if (isset($this->request->get['limit'])) {
         $limit = $this->request->get['limit'];
     } else {
         $limit = $this->config->get('config_product_limit');
     }
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     if (isset($this->request->get['path'])) {
         $url = '';
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $path = '';
         $parts = explode('_', (string) $this->request->get['path']);
         $category_id = (int) array_pop($parts);
         foreach ($parts as $path_id) {
             if (!$path) {
                 $path = (int) $path_id;
             } else {
                 $path .= '_' . (int) $path_id;
             }
             $category_info = $this->model_catalog_category->getCategory($path_id);
             if ($category_info) {
                 $data['breadcrumbs'][] = array('text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path . $url));
             }
         }
     } else {
         $category_id = 0;
     }
     $category_info = $this->model_catalog_category->getCategory($category_id);
     if ($category_info) {
         $this->document->setTitle($category_info['meta_title'] . " | " . $this->config->get("config_name"));
         $this->document->setDescription($category_info['meta_description']);
         $this->document->setKeywords($category_info['meta_keyword']);
         $this->document->addLink($this->url->link('product/category', 'path=' . $this->request->get['path']), 'canonical');
         $data['heading_title'] = $category_info['name'];
         $data['text_refine'] = $this->language->get('text_refine');
         $data['text_empty'] = $this->language->get('text_empty');
         $data['text_quantity'] = $this->language->get('text_quantity');
         $data['text_manufacturer'] = $this->language->get('text_manufacturer');
         $data['text_model'] = $this->language->get('text_model');
         $data['text_price'] = $this->language->get('text_price');
         $data['text_tax'] = $this->language->get('text_tax');
         $data['text_points'] = $this->language->get('text_points');
         $data['text_compare'] = sprintf($this->language->get('text_compare'), isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0);
         $data['text_sort'] = $this->language->get('text_sort');
         $data['text_limit'] = $this->language->get('text_limit');
         $data['button_cart'] = $this->language->get('button_cart');
         $data['button_wishlist'] = $this->language->get('button_wishlist');
         $data['button_compare'] = $this->language->get('button_compare');
         $data['button_continue'] = $this->language->get('button_continue');
         $data['button_list'] = $this->language->get('button_list');
         $data['button_grid'] = $this->language->get('button_grid');
         // Set the last category breadcrumb
         $data['breadcrumbs'][] = array('text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path']));
         if ($category_info['image']) {
             $data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
             $data['thumb_srcset'] = $this->model_tool_image->srcset($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
         } else {
             $data['thumb'] = '';
             $data['thumb_srcset'] = '';
         }
         $data['description'] = html_entity_decode($category_info['description'], ENT_QUOTES, 'UTF-8');
         $data['description_position'] = $category_info['description_position'];
         $data['compare'] = $this->url->link('product/compare');
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $data['categories'] = array();
         $results = $this->model_catalog_category->getCategories($category_id);
         foreach ($results as $result) {
             $filter_data = array('filter_category_id' => $result['category_id'], 'filter_sub_category' => true);
             $data['categories'][] = array('name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url));
         }
         $prods = array();
         $filter_data = array('filter_category_id' => $category_id, 'filter_filter' => $filter, 'filter_price' => $price, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit);
         $product_total = $this->model_catalog_product->getTotalProducts(array_merge($filter_data, $filter_options));
         $results = $this->model_catalog_product->getProducts(array_merge($filter_data, $filter_options));
         $column_left = $this->load->controller('common/column_left');
         $params['products'] = $results;
         $params['list'] = true;
         if ($column_left) {
             $params['qtd_column'] = 3;
         } else {
             $params['qtd_column'] = 4;
         }
         $data['products'] = $this->load->controller('product/product_built_list', $params);
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $data['sorts'] = array();
         $data['sorts'][] = array('text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.sort_order&order=ASC' . $url));
         $data['sorts'][] = array('text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=ASC' . $url));
         $data['sorts'][] = array('text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=pd.name&order=DESC' . $url));
         $data['sorts'][] = array('text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=DESC' . $url));
         $data['sorts'][] = array('text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=p.price&order=ASC' . $url));
         if ($this->config->get('config_review_status')) {
             $data['sorts'][] = array('text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=DESC' . $url));
             $data['sorts'][] = array('text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '&sort=rating&order=ASC' . $url));
         }
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         $data['limits'] = array();
         $limits = array_unique(array($this->config->get('config_product_limit'), 24, 48, 76, 100));
         sort($limits);
         foreach ($limits as $value) {
             $data['limits'][] = array('text' => $value, 'value' => $value, 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&limit=' . $value));
         }
         $url = '';
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $pagination = new Pagination();
         $pagination->total = $product_total;
         $pagination->page = $page;
         $pagination->limit = $limit;
         $pagination->url = $this->url->link('product/category', 'path=' . $this->request->get['path'] . $url . '&page={page}');
         $data['pagination'] = $pagination->render();
         $this->document->setPagePrev($pagination->getPagePrev());
         $this->document->setPageNext($pagination->getPageNext());
         $limit = $limit == 0 ? 1 : $limit;
         $data['results'] = sprintf($this->language->get('text_pagination'), $product_total ? ($page - 1) * $limit + 1 : 0, ($page - 1) * $limit > $product_total - $limit ? $product_total : ($page - 1) * $limit + $limit, $product_total, ceil($product_total / $limit));
         $data['sort'] = $sort;
         $data['order'] = $order;
         $data['limit'] = $limit;
         $data['continue'] = $this->url->link('common/home');
         $data['column_left'] = $this->load->controller('common/column_left');
         $data['column_right'] = $this->load->controller('common/column_right');
         $data['content_top'] = $this->load->controller('common/content_top');
         $data['content_bottom'] = $this->load->controller('common/content_bottom');
         $data['footer'] = $this->load->controller('common/footer');
         $data['header'] = $this->load->controller('common/header');
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/category.tpl')) {
             $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/category.tpl', $data));
         } else {
             $this->response->setOutput($this->load->view('default/template/product/category.tpl', $data));
         }
     } else {
         $url = '';
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['page'])) {
             $url .= '&page=' . $this->request->get['page'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $data['breadcrumbs'][] = array('text' => $this->language->get('text_error'), 'href' => $this->url->link('product/category', $url));
         $this->document->setTitle($this->language->get('text_error'));
         $data['heading_title'] = $this->language->get('text_error');
         $data['text_error'] = $this->language->get('text_error');
         $data['button_continue'] = $this->language->get('button_continue');
         $data['continue'] = $this->url->link('common/home');
         $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . ' 404 Not Found');
         $data['column_left'] = $this->load->controller('common/column_left');
         $data['column_right'] = $this->load->controller('common/column_right');
         $data['content_top'] = $this->load->controller('common/content_top');
         $data['content_bottom'] = $this->load->controller('common/content_bottom');
         $data['footer'] = $this->load->controller('common/footer');
         $data['header'] = $this->load->controller('common/header');
         if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) {
             $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/error/not_found.tpl', $data));
         } else {
             $this->response->setOutput($this->load->view('default/template/error/not_found.tpl', $data));
         }
     }
 }
Example #5
0
 public function index()
 {
     if (!$this->customer->isLogged()) {
         $this->session->data['redirect'] = $this->url->link('account/order', '', 'SSL');
         $this->response->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $this->language->load('account/recurring');
     $this->load->model('account/recurring');
     $this->document->setTitle($this->language->get('heading_title'));
     $url = '';
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $this->url->link('account/recurring', $url, 'SSL'));
     $data['heading_title'] = $this->language->get('heading_title');
     $data['column_date_added'] = $this->language->get('column_date_added');
     $data['column_status'] = $this->language->get('column_status');
     $data['column_product'] = $this->language->get('column_product');
     $data['column_action'] = $this->language->get('column_action');
     $data['column_recurring_id'] = $this->language->get('column_recurring_id');
     $data['text_empty'] = $this->language->get('text_empty');
     $data['button_view'] = $this->language->get('button_view');
     $data['button_continue'] = $this->language->get('button_continue');
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     $data['orders'] = array();
     $recurring_total = $this->model_account_recurring->getTotalRecurring();
     $results = $this->model_account_recurring->getAllProfiles(($page - 1) * 10, 10);
     $data['recurrings'] = array();
     if ($results) {
         foreach ($results as $result) {
             $data['recurrings'][] = array('id' => $result['order_recurring_id'], 'name' => $result['product_name'], 'status' => $result['status'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'href' => $this->url->link('account/recurring/info', 'recurring_id=' . $result['order_recurring_id'], 'SSL'));
         }
     }
     $data['status_types'] = array(1 => $this->language->get('text_status_inactive'), 2 => $this->language->get('text_status_active'), 3 => $this->language->get('text_status_suspended'), 4 => $this->language->get('text_status_cancelled'), 5 => $this->language->get('text_status_expired'), 6 => $this->language->get('text_status_pending'));
     $pagination = new Pagination();
     $pagination->total = $recurring_total;
     $pagination->page = $page;
     $pagination->limit = 10;
     $pagination->text = $this->language->get('text_pagination');
     $pagination->url = $this->url->link('account/recurring', 'page={page}', 'SSL');
     $data['pagination'] = $pagination->render();
     $this->document->setPagePrev($pagination->getPagePrev());
     $this->document->setPageNext($pagination->getPageNext());
     $data['continue'] = $this->url->link('account/account', '', 'SSL');
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/recurring_list.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/recurring_list.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/account/recurring_list.tpl', $data));
     }
 }
Example #6
0
 public function index()
 {
     if (!$this->customer->isLogged()) {
         $this->session->data['redirect'] = $this->url->link('account/download', '', 'SSL');
         $this->response->redirect($this->url->link('account/login', '', 'SSL'));
     }
     $this->load->language('account/download');
     $this->document->setTitle($this->language->get('heading_title'));
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_account'), 'href' => $this->url->link('account/account', '', 'SSL'));
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_downloads'), 'href' => $this->url->link('account/download', '', 'SSL'));
     $this->load->model('account/download');
     $data['heading_title'] = $this->language->get('heading_title');
     $data['text_empty'] = $this->language->get('text_empty');
     $data['column_order_id'] = $this->language->get('column_order_id');
     $data['column_name'] = $this->language->get('column_name');
     $data['column_size'] = $this->language->get('column_size');
     $data['column_date_added'] = $this->language->get('column_date_added');
     $data['button_download'] = $this->language->get('button_download');
     $data['button_continue'] = $this->language->get('button_continue');
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     $data['downloads'] = array();
     $download_total = $this->model_account_download->getTotalDownloads();
     $results = $this->model_account_download->getDownloads(($page - 1) * $this->config->get('config_product_limit'), $this->config->get('config_product_limit'));
     foreach ($results as $result) {
         if (file_exists(DIR_DOWNLOAD . $result['filename'])) {
             $size = filesize(DIR_DOWNLOAD . $result['filename']);
             $i = 0;
             $suffix = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
             while ($size / 1024 > 1) {
                 $size = $size / 1024;
                 $i++;
             }
             $data['downloads'][] = array('order_id' => $result['order_id'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'name' => $result['name'], 'size' => round(substr($size, 0, strpos($size, '.') + 4), 2) . $suffix[$i], 'href' => $this->url->link('account/download/download', 'download_id=' . $result['download_id'], 'SSL'));
         }
     }
     $pagination = new Pagination();
     $pagination->total = $download_total;
     $pagination->page = $page;
     $pagination->limit = $this->config->get('config_product_limit');
     $pagination->url = $this->url->link('account/download', 'page={page}', 'SSL');
     $data['pagination'] = $pagination->render();
     $this->document->setPagePrev($pagination->getPagePrev());
     $this->document->setPageNext($pagination->getPageNext());
     $data['results'] = sprintf($this->language->get('text_pagination'), $download_total ? ($page - 1) * $this->config->get('config_product_limit') + 1 : 0, ($page - 1) * $this->config->get('config_product_limit') > $download_total - $this->config->get('config_product_limit') ? $download_total : ($page - 1) * $this->config->get('config_product_limit') + $this->config->get('config_product_limit'), $download_total, ceil($download_total / $this->config->get('config_product_limit')));
     $data['continue'] = $this->url->link('account/account', '', 'SSL');
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/account/download.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/account/download.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/account/download.tpl', $data));
     }
 }
Example #7
0
 public function index()
 {
     $this->document->setPage('search');
     $this->load->language('product/search');
     $this->load->model('catalog/category');
     $this->load->model('catalog/product');
     $this->load->model('tool/image');
     if ($this->request->server['HTTPS']) {
         $server = $this->config->get('config_ssl');
     } else {
         $server = $this->config->get('config_url');
     }
     $this->load->model('extension/module');
     $filter_modules = $this->model_extension_module->getModuleByCode('filter_option');
     if (isset($this->request->get['search'])) {
         $search = str_replace('@', '', str_replace('=', '', $this->request->get['search']));
     } else {
         $search = '';
     }
     if (isset($this->request->get['tag'])) {
         $tag = $this->request->get['tag'];
     } else {
         $tag = '';
     }
     if (isset($this->request->get['filter'])) {
         $filter = $this->request->get['filter'];
     } else {
         $filter = '';
     }
     if (isset($this->request->get['description'])) {
         $description = $this->request->get['description'];
     } else {
         $description = '';
     }
     if (isset($this->request->get['price'])) {
         $price = str_replace('%', '', str_replace('=', '', $this->request->get['price']));
     } else {
         $price = '';
     }
     $filter_options = array();
     foreach ($filter_modules as $filter_module) {
         $setting_option = unserialize($filter_module['setting']);
         if (isset($this->request->get[$setting_option['param']])) {
             ${$setting_option}['param'] = str_replace('%', '', str_replace('=', '', $this->request->get[$setting_option['param']]));
             $filter_options[] = array('filter_' . $setting_option['param'] => ${$setting_option}['param']);
         } else {
             ${$setting_option}['param'] = '';
         }
     }
     if (isset($this->request->get['category_id'])) {
         $category_id = $this->request->get['category_id'];
     } else {
         $category_id = 0;
     }
     if (isset($this->request->get['path'])) {
         $path = str_replace('%', '', str_replace('=', '', $this->request->get['path']));
     } else {
         $path = '';
     }
     if (isset($this->request->get['sub_category'])) {
         $sub_category = $this->request->get['sub_category'];
     } else {
         $sub_category = '';
     }
     if (isset($this->request->get['sort'])) {
         $sort = $this->request->get['sort'];
     } else {
         $sort = $this->config->get('config_options_sort_order');
     }
     if (isset($this->request->get['order'])) {
         $order = $this->request->get['order'];
     } else {
         $order = $this->config->get('config_options_type_sort_order');
     }
     if (isset($this->request->get['page'])) {
         $page = $this->request->get['page'];
     } else {
         $page = 1;
     }
     if (isset($this->request->get['limit'])) {
         $limit = $this->request->get['limit'];
     } else {
         $limit = $this->config->get('config_product_limit');
     }
     if (isset($this->request->get['search'])) {
         $this->document->setTitle($this->language->get('heading_title') . ' - ' . $this->request->get['search']);
     } elseif (isset($this->request->get['tag'])) {
         $this->document->setTitle($this->language->get('heading_title') . ' - ' . $this->language->get('heading_tag') . $this->request->get['tag']);
     } else {
         $this->document->setTitle($this->language->get('heading_title'));
     }
     $data['url_search'] = URL_SEARCH;
     $data['breadcrumbs'] = array();
     $data['breadcrumbs'][] = array('text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'));
     $url = '';
     if (isset($this->request->get['search'])) {
         $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
     }
     if (isset($this->request->get['tag'])) {
         $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
     }
     if (isset($this->request->get['description'])) {
         $url .= '&description=' . $this->request->get['description'];
     }
     if (isset($this->request->get['filter'])) {
         $url .= '&filter=' . $this->request->get['filter'];
     }
     if (isset($this->request->get['category_id'])) {
         $url .= '&category_id=' . $this->request->get['category_id'];
     }
     if (isset($this->request->get['price'])) {
         $url .= '&price=' . $this->request->get['price'];
     }
     foreach ($filter_modules as $filter_module) {
         $setting_option = unserialize($filter_module['setting']);
         if (isset($this->request->get[$setting_option['param']])) {
             $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
         }
     }
     if (isset($this->request->get['path'])) {
         $url .= '&path=' . $this->request->get['path'];
     }
     if (isset($this->request->get['sub_category'])) {
         $url .= '&sub_category=' . $this->request->get['sub_category'];
     }
     if (isset($this->request->get['sort'])) {
         $url .= '&sort=' . $this->request->get['sort'];
     }
     if (isset($this->request->get['order'])) {
         $url .= '&order=' . $this->request->get['order'];
     }
     if (isset($this->request->get['page'])) {
         $url .= '&page=' . $this->request->get['page'];
     }
     if (isset($this->request->get['limit'])) {
         $url .= '&limit=' . $this->request->get['limit'];
     }
     $data['breadcrumbs'][] = array('text' => $this->language->get('heading_title'), 'href' => $server . URL_SEARCH . $url);
     if (isset($this->request->get['search'])) {
         $data['heading_title'] = $this->language->get('heading_title') . ' - ' . $this->request->get['search'];
     } else {
         $data['heading_title'] = $this->language->get('heading_title');
     }
     $data['text_empty'] = $this->language->get('text_empty');
     $data['text_search'] = $this->language->get('text_search');
     $data['text_keyword'] = $this->language->get('text_keyword');
     $data['text_category'] = $this->language->get('text_category');
     $data['text_sub_category'] = $this->language->get('text_sub_category');
     $data['text_quantity'] = $this->language->get('text_quantity');
     $data['text_manufacturer'] = $this->language->get('text_manufacturer');
     $data['text_model'] = $this->language->get('text_model');
     $data['text_price'] = $this->language->get('text_price');
     $data['text_tax'] = $this->language->get('text_tax');
     $data['text_points'] = $this->language->get('text_points');
     $data['text_compare'] = sprintf($this->language->get('text_compare'), isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0);
     $data['text_sort'] = $this->language->get('text_sort');
     $data['text_limit'] = $this->language->get('text_limit');
     $data['entry_search'] = $this->language->get('entry_search');
     $data['entry_description'] = $this->language->get('entry_description');
     $data['button_search'] = $this->language->get('button_search');
     $data['button_cart'] = $this->language->get('button_cart');
     $data['button_wishlist'] = $this->language->get('button_wishlist');
     $data['button_compare'] = $this->language->get('button_compare');
     $data['button_list'] = $this->language->get('button_list');
     $data['button_grid'] = $this->language->get('button_grid');
     $data['compare'] = $this->url->link('product/compare');
     $this->load->model('catalog/category');
     // 3 Level Category Search
     $data['categories'] = array();
     $categories_1 = $this->model_catalog_category->getCategories(0);
     foreach ($categories_1 as $category_1) {
         $level_2_data = array();
         $categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);
         foreach ($categories_2 as $category_2) {
             $level_3_data = array();
             $categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);
             foreach ($categories_3 as $category_3) {
                 $level_3_data[] = array('category_id' => $category_3['category_id'], 'name' => $category_3['name']);
             }
             $level_2_data[] = array('category_id' => $category_2['category_id'], 'name' => $category_2['name'], 'children' => $level_3_data);
         }
         $data['categories'][] = array('category_id' => $category_1['category_id'], 'name' => $category_1['name'], 'children' => $level_2_data);
     }
     $data['products'] = array();
     $prods = array();
     if (isset($this->request->get['search']) || isset($this->request->get['tag']) || isset($this->request->get['price']) || isset($this->request->get['path']) || isset($this->request->get['filter'])) {
         $filter_data = array('filter_name' => $search, 'filter_tag' => $tag, 'filter_description' => $description, 'filter_path' => $path, 'filter_price' => $price, 'filter_filter' => $filter, 'filter_category_id' => $category_id, 'filter_sub_category' => $sub_category, 'sort' => $sort, 'order' => $order, 'start' => ($page - 1) * $limit, 'limit' => $limit);
         $this->addMostSearched($search);
         $results = $this->model_catalog_product->getProducts(array_merge($filter_data, $filter_options));
         $product_total = $this->model_catalog_product->getTotalProducts(array_merge($filter_data, $filter_options));
         if (count($results) == 1) {
             foreach ($results as $result) {
                 $this->response->redirect($this->url->link('product/product', 'product_id=' . $result['product_id']));
             }
         }
         $column_left = $this->load->controller('common/column_left');
         $params['products'] = $results;
         $params['list'] = true;
         if ($column_left) {
             $params['qtd_column'] = 3;
         } else {
             $params['qtd_column'] = 4;
         }
         $data['products'] = $this->load->controller('product/product_built_list', $params);
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $data['sorts'] = array();
         $data['sorts'][] = array('text' => $this->language->get('text_default'), 'value' => 'p.sort_order-ASC', 'href' => $server . URL_SEARCH . '&sort=p.sort_order&order=ASC' . $url);
         $data['sorts'][] = array('text' => $this->language->get('text_name_asc'), 'value' => 'pd.name-ASC', 'href' => $server . URL_SEARCH . '&sort=pd.name&order=ASC' . $url);
         $data['sorts'][] = array('text' => $this->language->get('text_name_desc'), 'value' => 'pd.name-DESC', 'href' => $server . URL_SEARCH . '&sort=pd.name&order=DESC' . $url);
         $data['sorts'][] = array('text' => $this->language->get('text_price_desc'), 'value' => 'p.price-DESC', 'href' => $server . URL_SEARCH . '&sort=p.price&order=DESC' . $url);
         $data['sorts'][] = array('text' => $this->language->get('text_price_asc'), 'value' => 'p.price-ASC', 'href' => $server . URL_SEARCH . '&sort=p.price&order=ASC' . $url);
         if ($this->config->get('config_review_status')) {
             $data['sorts'][] = array('text' => $this->language->get('text_rating_desc'), 'value' => 'rating-DESC', 'href' => $server . URL_SEARCH . '&sort=rating&order=DESC' . $url);
             $data['sorts'][] = array('text' => $this->language->get('text_rating_asc'), 'value' => 'rating-ASC', 'href' => $server . URL_SEARCH . '&sort=rating&order=ASC' . $url);
         }
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         $data['limits'] = array();
         $limits = array_unique(array($this->config->get('config_product_limit'), 24, 48, 76, 100));
         sort($limits);
         foreach ($limits as $value) {
             $data['limits'][] = array('text' => $value, 'value' => $value, 'href' => $server . URL_SEARCH . $url . '&limit=' . $value);
         }
         $url = '';
         if (isset($this->request->get['search'])) {
             $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['tag'])) {
             $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
         }
         if (isset($this->request->get['description'])) {
             $url .= '&description=' . $this->request->get['description'];
         }
         if (isset($this->request->get['filter'])) {
             $url .= '&filter=' . $this->request->get['filter'];
         }
         if (isset($this->request->get['category_id'])) {
             $url .= '&category_id=' . $this->request->get['category_id'];
         }
         foreach ($filter_modules as $filter_module) {
             $setting_option = unserialize($filter_module['setting']);
             if (isset($this->request->get[$setting_option['param']])) {
                 $url .= '&' . $setting_option['param'] . '=' . $this->request->get[$setting_option['param']];
             }
         }
         if (isset($this->request->get['price'])) {
             $url .= '&price=' . $this->request->get['price'];
         }
         if (isset($this->request->get['path'])) {
             $url .= '&path=' . $this->request->get['path'];
         }
         if (isset($this->request->get['sub_category'])) {
             $url .= '&sub_category=' . $this->request->get['sub_category'];
         }
         if (isset($this->request->get['sort'])) {
             $url .= '&sort=' . $this->request->get['sort'];
         }
         if (isset($this->request->get['order'])) {
             $url .= '&order=' . $this->request->get['order'];
         }
         if (isset($this->request->get['limit'])) {
             $url .= '&limit=' . $this->request->get['limit'];
         }
         $pagination = new Pagination();
         $pagination->total = $product_total;
         $pagination->page = $page;
         $pagination->limit = $limit;
         $pagination->url = $server . URL_SEARCH . $url . '&page={page}';
         $data['pagination'] = $pagination->render();
         $this->document->setPagePrev($pagination->getPagePrev());
         $this->document->setPageNext($pagination->getPageNext());
         $limit = $limit == 0 ? 1 : $limit;
         $data['results'] = sprintf($this->language->get('text_pagination'), $product_total ? ($page - 1) * $limit + 1 : 0, ($page - 1) * $limit > $product_total - $limit ? $product_total : ($page - 1) * $limit + $limit, $product_total, ceil($product_total / $limit));
     }
     $data['search'] = $search;
     $data['price'] = $price;
     foreach ($filter_modules as $filter_module) {
         $setting_option = unserialize($filter_module['setting']);
         $data[$setting_option['param']] = ${$setting_option}['param'];
         $data['param'] = $setting_option['param'];
     }
     $data['path'] = $path;
     $data['description'] = $description;
     $data['category_id'] = $category_id;
     $data['sub_category'] = $sub_category;
     $data['filter'] = $filter;
     $data['sort'] = $sort;
     $data['order'] = $order;
     $data['limit'] = $limit;
     $data['column_left'] = $this->load->controller('common/column_left');
     $data['column_right'] = $this->load->controller('common/column_right');
     $data['content_top'] = $this->load->controller('common/content_top');
     $data['content_bottom'] = $this->load->controller('common/content_bottom');
     $data['footer'] = $this->load->controller('common/footer');
     $data['header'] = $this->load->controller('common/header');
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/search.tpl')) {
         $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/search.tpl', $data));
     } else {
         $this->response->setOutput($this->load->view('default/template/product/search.tpl', $data));
     }
 }