Перейти до вмісту
Пошук в
  • Детальніше...
Шукати результати, які ...
Шукати результати в ...

Не работает поиск


Recommended Posts

Parse error: syntax error, unexpected '$data' (T_VARIABLE), expecting function (T_FUNCTION) in /home/host1322690/kuzov73.ru/htdocs/www/system/storage/modification/catalog/controller/product/search.php on line 710

 появилась такая вот ошибка,что сделать,не знаю.Помогите

  1. 
     
    1. <?php
    2. class ControllerProductSearch extends Controller {
    3.  
    4. public function ajax() {
    5. $this->load->model('tool/image');
    6. $this->load->model('catalog/product');
    7. $this->load->language('product/product');
    8.  
    9. $product_data = array();
    10.  
    11. if (isset($this->request->get['keyword'])) {
    12. $sql = "SELECT p.product_id, (SELECT AVG(rating) AS total FROM " . DB_PREFIX . "review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT price FROM " . DB_PREFIX . "product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM " . DB_PREFIX . "product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special";
    13.  
    14. if (isset($this->request->get['filter_category_id']) && !empty($this->request->get['filter_category_id'])) {
    15. $sql .= " FROM " . DB_PREFIX . "category_path cp LEFT JOIN " . DB_PREFIX . "product_to_category p2c ON (cp.category_id = p2c.category_id)";
    16. $sql .= " LEFT JOIN " . DB_PREFIX . "product p ON (p2c.product_id = p.product_id)";
    17. } else {
    18. $sql .= " FROM " . DB_PREFIX . "product p";
    19. }
    20.  
    21. $sql .= " LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) WHERE pd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '" . (int)$this->config->get('config_store_id') . "'";
    22.  
    23. if (isset($this->request->get['filter_category_id']) && !empty($this->request->get['filter_category_id'])) {
    24. $sql .= " AND cp.path_id = '" . (int)$this->request->get['filter_category_id'] . "'";
    25. }
    26.  
    27. if (isset($this->request->get['keyword']) && !empty($this->request->get['keyword'])) {
    28. $sql .= " AND (";
    29. $implode = array();
    30. $words = explode(' ', trim(preg_replace('/\s+/', ' ', $this->request->get['keyword'])));
    31.  
    32. foreach ($words as $word) {
    33. $implode[] = "pd.name LIKE '%" . $this->db->escape($word) . "%'";
    34. }
    35.  
    36. if ($implode) {
    37. $sql .= " " . implode(" AND ", $implode) . "";
    38. }
    39.  
    40. $sql .= " OR LCASE(p.sku) LIKE '%" . $this->db->escape(utf8_strtolower($this->request->get['keyword'])) . "%'";
    41. $sql .= " OR LCASE(p.model) LIKE '%" . $this->db->escape(utf8_strtolower($this->request->get['keyword'])) . "%'";
    42. $sql .= ")";
    43. }
    44.  
    45. $sql .= " GROUP BY p.product_id ORDER BY p.sort_order ASC, LOWER(pd.name) ASC, LOWER(p.model) ASC LIMIT 15";
    46.  
    47. $query = $this->db->query($sql);
    48.  
    49. foreach ($query->rows as $result) {
    50. $product_info = $this->model_catalog_product->getProduct($result['product_id']);
    51.  
    52. if ($product_info['image']) {
    53. $image = $this->model_tool_image->resize($product_info['image'], 60, 60);
    54. } else {
    55. $image = $this->model_tool_image->resize('placeholder.png', 60, 60);
    56. }
    57.  
    58. if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {
    59. $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
    60. } else {
    61. $price = false;
    62. }
    63.  
    64. if ((float)$product_info['special']) {
    65. $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
    66. } else {
    67. $special = false;
    68. }
    69.  
    70. if ($product_info['quantity'] <= 0) {
    71. $stock = $product_info['stock_status'];
    72. } elseif ($this->config->get('config_stock_display')) {
    73. $stock = $product_info['quantity'];
    74. } else {
    75. $stock = $this->language->get('text_instock');
    76. }
    77.  
    78. $product_data[] = array(
    79. 'name' => htmlspecialchars_decode($product_info['name'] . ' (' . $product_info['model'] . ')', ENT_QUOTES),
    80. 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),
    81. 'image' => $image,
    82. 'price' => $price,
    83. 'special' => $special,
    84. 'stock' => $stock
    85. );
    86. }
    87. }
    88.  
    89. echo json_encode($product_data);
    90. }
    91. public function index() {
    92.  
    93. $data['oct_popup_view_data'] = $this->config->get('oct_popup_view_data');
    94. $data['button_popup_view'] = $this->language->get('button_popup_view');
    95.  
    96.  
    97. $this->load->language('product/search');
    98.  
    99. $oct_data = $this->config->get('oct_techstore_data');
    100.  
    101. if (isset($oct_data['oct_lazyload']) && $oct_data['oct_lazyload'] == 1) {
    102. $this->document->addScript('catalog/view/theme/oct_techstore/js/lazyload/jquery.lazyload.min.js');
    103.  
    104. $data['oct_lazyload'] = $oct_data['oct_lazyload'];
    105.  
    106. if (isset($oct_data['oct_lazyload_image']) && $oct_data['oct_lazyload_image']) {
    107. $data['oct_lazyload_image'] = 'image/'.$oct_data['oct_lazyload_image'];
    108. } else {
    109. $data['oct_lazyload_image'] = '/image/catalog/1lazy/oct_loader_product.gif';
    110. }
    111. }
    112.  
    113.  
    114. $this->load->model('catalog/category');
    115.  
    116. $this->load->model('catalog/product');
    117.  
    118. $this->load->model('tool/image');
    119.  
    120. if (isset($this->request->get['search'])) {
    121. $search = $this->request->get['search'];
    122. } else {
    123. $search = '';
    124. }
    125.  
    126. if (isset($this->request->get['tag'])) {
    127. $tag = $this->request->get['tag'];
    128. } elseif (isset($this->request->get['search'])) {
    129. $tag = $this->request->get['search'];
    130. } else {
    131. $tag = '';
    132. }
    133.  
    134. if (isset($this->request->get['description'])) {
    135. $description = $this->request->get['description'];
    136. } else {
    137. $description = '';
    138. }
    139.  
    140. if (isset($this->request->get['category_id'])) {
    141. $category_id = $this->request->get['category_id'];
    142. } else {
    143. $category_id = 0;
    144. }
    145.  
    146. if (isset($this->request->get['sub_category'])) {
    147. $sub_category = $this->request->get['sub_category'];
    148. } else {
    149. $sub_category = '';
    150. }
    151.  
    152. if (isset($this->request->get['sort'])) {
    153. $sort = $this->request->get['sort'];
    154. } else {
    155. $sort = 'p.sort_order';
    156. }
    157.  
    158. if (isset($this->request->get['order'])) {
    159. $order = $this->request->get['order'];
    160. } else {
    161. $order = 'ASC';
    162. }
    163.  
    164. if (isset($this->request->get['page'])) {
    165. $page = $this->request->get['page'];
    166. } else {
    167. $page = 1;
    168. }
    169.  
    170. if (isset($this->request->get['limit'])) {
    171. $limit = (int)$this->request->get['limit'];
    172. } else {
    173. $limit = $this->config->get($this->config->get('config_theme') . '_product_limit');
    174. }
    175.  
    176. if (isset($this->request->get['search'])) {
    177. $this->document->setTitle($this->language->get('heading_title') . ' - ' . $this->request->get['search']);
    178. } elseif (isset($this->request->get['tag'])) {
    179. $this->document->setTitle($this->language->get('heading_title') . ' - ' . $this->language->get('heading_tag') . $this->request->get['tag']);
    180. } else {
    181. $this->document->setTitle($this->language->get('heading_title'));
    182. }
    183.  
    184. $data['breadcrumbs'] = array();
    185.  
    186. $data['breadcrumbs'][] = array(
    187. 'text' => $this->language->get('text_home'),
    188. 'href' => $this->url->link('common/home')
    189. );
    190.  
    191. $url = '';
    192.  
    193. if (isset($this->request->get['search'])) {
    194. $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
    195. }
    196.  
    197. if (isset($this->request->get['tag'])) {
    198. $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
    199. }
    200.  
    201. if (isset($this->request->get['description'])) {
    202. $url .= '&description=true' . $this->request->get['description'];
    203. }
    204.  
    205. if (isset($this->request->get['category_id'])) {
    206. $url .= '&category_id=' . $this->request->get['category_id'];
    207. }
    208.  
    209. if (isset($this->request->get['sub_category'])) {
    210. $url .= '&sub_category=' . $this->request->get['sub_category'];
    211. }
    212.  
    213. if (isset($this->request->get['sort'])) {
    214. $url .= '&sort=' . $this->request->get['sort'];
    215. }
    216.  
    217. if (isset($this->request->get['order'])) {
    218. $url .= '&order=' . $this->request->get['order'];
    219. }
    220.  
    221. if (isset($this->request->get['page'])) {
    222. $url .= '&page=' . $this->request->get['page'];
    223. }
    224.  
    225. if (isset($this->request->get['limit'])) {
    226. $url .= '&limit=' . $this->request->get['limit'];
    227. }
    228.  
    229. $data['breadcrumbs'][] = array(
    230. 'text' => $this->language->get('heading_title'),
    231. 'href' => $this->url->link('product/search', $url)
    232. );
    233.  
    234. if (isset($this->request->get['search'])) {
    235. $data['heading_title'] = $this->language->get('heading_title') . ' - ' . $this->request->get['search'];
    236. } else {
    237. $data['heading_title'] = $this->language->get('heading_title');
    238. }
    239.  
    240. $data['text_empty'] = $this->language->get('text_empty');
    241. $data['text_search'] = $this->language->get('text_search');
    242. $data['text_keyword'] = $this->language->get('text_keyword');
    243. $data['text_category'] = $this->language->get('text_category');
    244. $data['text_sub_category'] = $this->language->get('text_sub_category');
    245. $data['text_quantity'] = $this->language->get('text_quantity');
    246. $data['text_manufacturer'] = $this->language->get('text_manufacturer');
    247. $data['text_model'] = $this->language->get('text_model');
    248. $data['text_price'] = $this->language->get('text_price');
    249. $data['text_tax'] = $this->language->get('text_tax');
    250. $data['text_points'] = $this->language->get('text_points');
    251. $data['text_compare'] = sprintf($this->language->get('text_compare'), (isset($this->session->data['compare']) ? count($this->session->data['compare']) : 0));
    252. $data['text_sort'] = $this->language->get('text_sort');
    253. $data['text_limit'] = $this->language->get('text_limit');
    254.  
    255. $data['entry_search'] = $this->language->get('entry_search');
    256. $data['entry_description'] = $this->language->get('entry_description');
    257.  
    258. $data['button_search'] = $this->language->get('button_search');
    259. $data['button_cart'] = $this->language->get('button_cart');
    260. $data['button_wishlist'] = $this->language->get('button_wishlist');
    261. $data['button_compare'] = $this->language->get('button_compare');
    262. $data['button_list'] = $this->language->get('button_list');
    263. $data['button_grid'] = $this->language->get('button_grid');
    264.  
    265. $data['compare'] = $this->url->link('product/compare');
    266.  
    267. $this->load->model('catalog/category');
    268.  
    269. // 3 Level Category Search
    270. $data['categories'] = array();
    271.  
    272. $categories_1 = $this->model_catalog_category->getCategories(0);
    273.  
    274. foreach ($categories_1 as $category_1) {
    275. $level_2_data = array();
    276.  
    277. $categories_2 = $this->model_catalog_category->getCategories($category_1['category_id']);
    278.  
    279. foreach ($categories_2 as $category_2) {
    280. $level_3_data = array();
    281.  
    282. $categories_3 = $this->model_catalog_category->getCategories($category_2['category_id']);
    283.  
    284. foreach ($categories_3 as $category_3) {
    285. $level_3_data[] = array(
    286. 'category_id' => $category_3['category_id'],
    287. 'name' => $category_3['name'],
    288. );
    289. }
    290.  
    291. $level_2_data[] = array(
    292. 'category_id' => $category_2['category_id'],
    293. 'name' => $category_2['name'],
    294. 'children' => $level_3_data
    295. );
    296. }
    297.  
    298. $data['categories'][] = array(
    299. 'category_id' => $category_1['category_id'],
    300. 'name' => $category_1['name'],
    301. 'children' => $level_2_data
    302. );
    303. }
    304.  
    305. $data['products'] = array();
    306.  
    307. if (isset($this->request->get['search']) || isset($this->request->get['tag'])) {
    308. $filter_data = array(
    309. 'filter_name' => $search,
    310. 'filter_tag' => $tag,
    311. 'filter_description' => $description,
    312. 'filter_category_id' => $category_id,
    313. 'filter_sub_category' => $sub_category,
    314. 'sort' => $sort,
    315. 'order' => $order,
    316. 'start' => ($page - 1) * $limit,
    317. 'limit' => $limit
    318. );
    319.  
    320. $product_total = $this->model_catalog_product->getTotalProducts($filter_data);
    321.  
    322. $results = $this->model_catalog_product->getProducts($filter_data);
    323.  
    324. foreach ($results as $result) {
    325. if ($result['image']) {
    326. $image = $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
    327. } else {
    328. $image = $this->model_tool_image->resize('placeholder.png', $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
    329. }
    330.  
    331. if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
    332. $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
    333. } else {
    334. $price = false;
    335. }
    336.  
    337. if ((float)$result['special']) {
    338. $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
    339. } else {
    340. $special = false;
    341. }
    342.  
    343. if ($this->config->get('config_tax')) {
    344. $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);
    345. } else {
    346. $tax = false;
    347. }
    348.  
    349. if ($this->config->get('config_review_status')) {
    350. $rating = (int)$result['rating'];
    351. } else {
    352. $rating = false;
    353. }
    354.  
    355.  
    356. // oct_advanced_attributes_settings start
    357. $oct_attributes = array();
    358. $oct_advanced_attributes_settings_data = $this->config->get('oct_advanced_attributes_settings_data');
    359.  
    360. if (isset($oct_advanced_attributes_settings_data['status']) && $oct_advanced_attributes_settings_data['status']) {
    361. foreach ($this->model_catalog_product->getProductAttributes($result['product_id']) as $attribute_group) {
    362. foreach ($attribute_group['attribute'] as $attribute) {
    363. if (isset($oct_advanced_attributes_settings_data['allowed_attributes']) && (in_array($attribute['attribute_id'], $oct_advanced_attributes_settings_data['allowed_attributes']))) {
    364. $oct_attributes[] = array(
    365. 'name' => $attribute['name'],
    366. 'text' => $attribute['text']
    367. );
    368. }
    369. }
    370. }
    371. }
    372. // oct_advanced_attributes_settings end
    373.  
    374.  
    375. // oct_advanced_options_settings start
    376. $oct_options = array();
    377. $oct_advanced_options_settings_data = $this->config->get('oct_advanced_options_settings_data');
    378.  
    379. foreach ($this->model_catalog_product->getProductOptions($result['product_id']) as $option) {
    380. $product_option_value_data = array();
    381.  
    382. if (isset($oct_advanced_options_settings_data['allowed_options']) && (in_array($option['option_id'], $oct_advanced_options_settings_data['allowed_options']))) {
    383. foreach ($option['product_option_value'] as $option_value) {
    384. if (!$option_value['subtract'] || ($option_value['quantity'] >= 0)) {
    385. if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) {
    386. $oct_option_price = $this->currency->format($this->tax->calculate($option_value['price'], $result['tax_class_id'], $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency']);
    387. } else {
    388. $oct_option_price = false;
    389. }
    390.  
    391. $product_option_value_data[] = array(
    392. 'product_option_value_id' => $option_value['product_option_value_id'],
    393. 'option_value_id' => $option_value['option_value_id'],
    394. 'name' => $option_value['name'],
    395. 'image' => $option_value['image'] ? $this->model_tool_image->resize($option_value['image'], 50, 50) : '',
    396. 'price' => $oct_option_price,
    397. 'price_prefix' => $option_value['price_prefix']
    398. );
    399. }
    400. }
    401.  
    402. $oct_options[] = array(
    403. 'product_option_id' => $option['product_option_id'],
    404. 'product_option_value' => $product_option_value_data,
    405. 'option_id' => $option['option_id'],
    406. 'name' => $option['name'],
    407. 'type' => $option['type'],
    408. 'value' => $option['value'],
    409. 'required' => $option['required']
    410. );
    411. }
    412. }
    413. // oct_advanced_options_settings end
    414.  
    415.  
    416. $oct_product_stickers_data = $this->config->get('oct_product_stickers_data');
    417. $oct_product_stickers = array();
    418.  
    419. if (isset($oct_product_stickers_data['status']) && $oct_product_stickers_data['status']) {
    420. $this->load->model('catalog/oct_product_stickers');
    421.  
    422. if (isset($result['oct_product_stickers']) && $result['oct_product_stickers']) {
    423. $oct_product_stickers = $this->model_catalog_oct_product_stickers->getProductStickers(unserialize($result['oct_product_stickers']));
    424. }
    425. }
    426.  
    427.  
    428. // oct_techstore start
    429. if ($result['quantity'] <= 0) {
    430. $stock = $result['stock_status'];
    431. } elseif ($this->config->get('config_stock_display')) {
    432. $stock = $result['quantity'];
    433. } else {
    434. $stock = $this->language->get('text_instock');
    435. }
    436. // oct_techstore end
    437.  
    438.  
    439. $oct_product_preorder_text = $this->config->get('oct_product_preorder_text');
    440. $oct_product_preorder_data = $this->config->get('oct_product_preorder_data');
    441. $oct_product_preorder_language = $this->load->language('extension/module/oct_product_preorder');
    442. $data['text_stock'] = $this->language->get('text_stock');
    443.  
    444. if (isset($oct_product_preorder_data['status']) && $oct_product_preorder_data['status'] && isset($oct_product_preorder_data['stock_statuses']) && isset($result['oct_stock_status_id']) && in_array($result['oct_stock_status_id'], $oct_product_preorder_data['stock_statuses'])) {
    445. $product_preorder_text = $oct_product_preorder_text[$this->session->data['language']]['call_button'];
    446. $product_preorder_status = 1;
    447. } else {
    448. $product_preorder_text = $oct_product_preorder_language['text_out_of_stock'];
    449. $product_preorder_status = 2;
    450. }
    451.  
    452. $data['products'][] = array(
    453.  
    454. // oct_techstore start
    455. 'reviews' => $result['reviews'],
    456. 'saving' => round((($result['price'] - $result['special'])/($result['price'] + 0.01))*100, 0),
    457. 'model' => $result['model'],
    458. 'stock' => $stock,
    459. // oct_techstore end
    460.  
    461.  
    462. 'oct_product_stickers' => $oct_product_stickers,
    463.  
    464.  
    465. // oct_advanced_options_settings start
    466. 'oct_options' => $oct_options,
    467. // oct_advanced_options_settings end
    468.  
    469.  
    470. // oct_advanced_attributes_settings start
    471. 'oct_attributes' => $oct_attributes,
    472. // oct_advanced_attributes_settings end
    473.  
    474. 'product_id' => $result['product_id'],
    475. 'thumb' => $image,
    476. 'name' => $result['name'],
    477. 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
    478.  
    479. 'quantity' => $result['quantity'],
    480. 'product_preorder_text' => $product_preorder_text,
    481. 'product_preorder_status' => $product_preorder_status,
    482.  
    483. 'price' => $price,
    484. 'special' => $special,
    485. 'tax' => $tax,
    486. 'minimum' => ($result['minimum'] > 0) ? $result['minimum'] : 1,
    487. 'rating' => $rating,
    488. 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url)
    489. );
    490. }
    491.  
    492. $url = '';
    493.  
    494. if (isset($this->request->get['search'])) {
    495. $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
    496. }
    497.  
    498.  
    499.  
    500.  
    501. $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
    502. }
    503.  
    504.  
    505.  
    506. if (isset($this->request->get['description'])) {
    507. $url .= '&description=true' . $this->request->get['description'];
    508. }
    509.  
    510. if (isset($this->request->get['category_id'])) {
    511. $url .= '&category_id=' . $this->request->get['category_id'];
    512. }
    513.  
    514. if (isset($this->request->get['sub_category'])) {
    515. $url .= '&sub_category=' . $this->request->get['sub_category'];
    516. }
    517.  
    518. if (isset($this->request->get['limit'])) {
    519. $url .= '&limit=' . $this->request->get['limit'];
    520. }
    521.  
    522. $data['sorts'] = array();
    523.  
    524. $data['sorts'][] = array(
    525. 'text' => $this->language->get('text_default'),
    526. 'value' => 'p.sort_order-ASC',
    527. 'href' => $this->url->link('product/search', 'sort=p.sort_order&order=ASC' . $url)
    528. );
    529.  
    530. $data['sorts'][] = array(
    531. 'text' => $this->language->get('text_name_asc'),
    532. 'value' => 'pd.name-ASC',
    533. 'href' => $this->url->link('product/search', 'sort=pd.name&order=ASC' . $url)
    534. );
    535.  
    536. $data['sorts'][] = array(
    537. 'text' => $this->language->get('text_name_desc'),
    538. 'value' => 'pd.name-DESC',
    539. 'href' => $this->url->link('product/search', 'sort=pd.name&order=DESC' . $url)
    540. );
    541.  
    542. $data['sorts'][] = array(
    543. 'text' => $this->language->get('text_price_asc'),
    544. 'value' => 'p.price-ASC',
    545. 'href' => $this->url->link('product/search', 'sort=p.price&order=ASC' . $url)
    546. );
    547.  
    548. $data['sorts'][] = array(
    549. 'text' => $this->language->get('text_price_desc'),
    550. 'value' => 'p.price-DESC',
    551. 'href' => $this->url->link('product/search', 'sort=p.price&order=DESC' . $url)
    552. );
    553.  
    554. if ($this->config->get('config_review_status')) {
    555. $data['sorts'][] = array(
    556. 'text' => $this->language->get('text_rating_desc'),
    557. 'value' => 'rating-DESC',
    558. 'href' => $this->url->link('product/search', 'sort=rating&order=DESC' . $url)
    559. );
    560.  
    561. $data['sorts'][] = array(
    562. 'text' => $this->language->get('text_rating_asc'),
    563. 'value' => 'rating-ASC',
    564. 'href' => $this->url->link('product/search', 'sort=rating&order=ASC' . $url)
    565. );
    566. }
    567.  
    568. $data['sorts'][] = array(
    569. 'text' => $this->language->get('text_model_asc'),
    570. 'value' => 'p.model-ASC',
    571. 'href' => $this->url->link('product/search', 'sort=p.model&order=ASC' . $url)
    572. );
    573.  
    574. $data['sorts'][] = array(
    575. 'text' => $this->language->get('text_model_desc'),
    576. 'value' => 'p.model-DESC',
    577. 'href' => $this->url->link('product/search', 'sort=p.model&order=DESC' . $url)
    578. );
    579.  
    580. $url = '';
    581.  
    582. if (isset($this->request->get['search'])) {
    583. $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
    584. }
    585.  
    586. if (isset($this->request->get['tag'])) {
    587. $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
    588. }
    589.  
    590. if (isset($this->request->get['description'])) {
    591. $url .= '&description=true' . $this->request->get['description'];
    592. }
    593.  
    594. if (isset($this->request->get['category_id'])) {
    595. $url .= '&category_id=' . $this->request->get['category_id'];
    596. }
    597.  
    598. if (isset($this->request->get['sub_category'])) {
    599. $url .= '&sub_category=' . $this->request->get['sub_category'];
    600. }
    601.  
    602. if (isset($this->request->get['sort'])) {
    603. $url .= '&sort=' . $this->request->get['sort'];
    604. }
    605.  
    606. if (isset($this->request->get['order'])) {
    607. $url .= '&order=' . $this->request->get['order'];
    608. }
    609.  
    610. $data['limits'] = array();
    611.  
    612. $limits = array_unique(array($this->config->get($this->config->get('config_theme') . '_product_limit'), 25, 50, 75, 100));
    613.  
    614. sort($limits);
    615.  
    616. foreach($limits as $value) {
    617. $data['limits'][] = array(
    618. 'text' => $value,
    619. 'value' => $value,
    620. 'href' => $this->url->link('product/search', $url . '&limit=' . $value)
    621. );
    622. }
    623.  
    624. $url = '';
    625.  
    626. if (isset($this->request->get['search'])) {
    627. $url .= '&search=' . urlencode(html_entity_decode($this->request->get['search'], ENT_QUOTES, 'UTF-8'));
    628. }
    629.  
    630. if (isset($this->request->get['tag'])) {
    631. $url .= '&tag=' . urlencode(html_entity_decode($this->request->get['tag'], ENT_QUOTES, 'UTF-8'));
    632. }
    633.  
    634. if (isset($this->request->get['description'])) {
    635. $url .= '&description=true' . $this->request->get['description'];
    636. }
    637.  
    638. if (isset($this->request->get['category_id'])) {
    639. $url .= '&category_id=' . $this->request->get['category_id'];
    640. }
    641.  
    642. if (isset($this->request->get['sub_category'])) {
    643. $url .= '&sub_category=' . $this->request->get['sub_category'];
    644. }
    645.  
    646. if (isset($this->request->get['sort'])) {
    647. $url .= '&sort=' . $this->request->get['sort'];
    648. }
    649.  
    650. if (isset($this->request->get['order'])) {
    651. $url .= '&order=' . $this->request->get['order'];
    652. }
    653.  
    654. if (isset($this->request->get['limit'])) {
    655. $url .= '&limit=' . $this->request->get['limit'];
    656. }
    657.  
    658. $pagination = new Pagination();
    659. $pagination->total = $product_total;
    660. $pagination->page = $page;
    661. $pagination->limit = $limit;
    662. $pagination->url = $this->url->link('product/search', $url . '&page={page}');
    663.  
    664. $data['pagination'] = $pagination->render();
    665.  
    666. $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));
    667.  
    668. if ($page == 1) {
    669. $this->document->addLink($this->url->link('product/search', '', true), 'canonical');
    670. } elseif ($page == 2) {
    671. $this->document->addLink($this->url->link('product/search', '', true), 'prev');
    672. } else {
    673. $this->document->addLink($this->url->link('product/search', $url . '&page='. ($page - 1), true), 'prev');
    674. }
    675.  
    676. if ($limit && ceil($product_total / $limit) > $page) {
    677. $this->document->addLink($this->url->link('product/search', $url . '&page='. ($page + 1), true), 'next');
    678. }
    679.  
    680. if (isset($this->request->get['search']) && $this->config->get('config_customer_search')) {
    681. $this->load->model('account/search');
    682.  
    683. if ($this->customer->isLogged()) {
    684. $customer_id = $this->customer->getId();
    685. } else {
    686. $customer_id = 0;
    687. }
    688.  
    689. if (isset($this->request->server['REMOTE_ADDR'])) {
    690. $ip = $this->request->server['REMOTE_ADDR'];
    691. } else {
    692. $ip = '';
    693. }
    694.  
    695. $search_data = array(
    696. 'keyword' => $search,
    697. 'category_id' => $category_id,
    698. 'sub_category' => $sub_category,
    699. 'description' => $description,
    700. 'products' => $product_total,
    701. 'customer_id' => $customer_id,
    702. 'ip' => $ip
    703. );
    704.  
    705. $this->model_account_search->addSearch($search_data);
    706. }
    707. }
    708.  
    709. $data['search'] = $search;
    710. $data['description'] = $description;
    711. $data['category_id'] = $category_id;
    712. $data['sub_category'] = $sub_category;
    713.  
    714. $data['sort'] = $sort;
    715. $data['order'] = $order;
    716. $data['limit'] = $limit;
    717.  
    718. $data['column_left'] = $this->load->controller('common/column_left');
    719. $data['column_right'] = $this->load->controller('common/column_right');
    720. $data['content_top'] = $this->load->controller('common/content_top');
    721. $data['content_bottom'] = $this->load->controller('common/content_bottom');
    722. $data['footer'] = $this->load->controller('common/footer');
    723. $data['header'] = $this->load->controller('common/header');
    724.  
    725. $this->response->setOutput($this->load->view('product/search', $data));
    726. }
    727. }
    728.  
    Подсветка синтаксиса реализована GeSHi
    Создано на net2ftp - a web based FTP client
Змінено користувачем AlexeyKuzov73
Надіслати
Поділитися на інших сайтах


Из этого когда 728 фигурная скобка лишняя) это так к слову)

Надіслати
Поділитися на інших сайтах

залил в редактор php который показывал где ошибки,и методом подбора решилась проблема) танцы с бубном помогли

 

Змінено користувачем AlexeyKuzov73
Надіслати
Поділитися на інших сайтах


Створіть аккаунт або увійдіть для коментування

Ви повинні бути користувачем, щоб залишити коментар

Створити обліковий запис

Зареєструйтеся для отримання облікового запису. Це просто!

Зареєструвати аккаунт

Вхід

Уже зареєстровані? Увійдіть тут.

Вхід зараз
  • Зараз на сторінці   0 користувачів

    • Ні користувачів, які переглядиють цю сторінку
×
×
  • Створити...

Important Information

На нашому сайті використовуються файли cookie і відбувається обробка деяких персональних даних користувачів, щоб поліпшити користувальницький інтерфейс. Щоб дізнатися для чого і які персональні дані ми обробляємо перейдіть за посиланням . Якщо Ви натиснете «Я даю згоду», це означає, що Ви розумієте і приймаєте всі умови, зазначені в цьому Повідомленні про конфіденційність.