Перейти к публикации
Поиск в
  • Дополнительно...
Искать результаты, содержащие...
Искать результаты в...

Dart990

Пользователи
  
  • Публикаций

    167
  • Зарегистрирован

  • Посещение

Все публикации пользователя Dart990

  1. Там по дефолту нет модулей?
  2. Не знаю, я не владелец сайта а контент-менеджер. Так как же можно сделать вывод при нажатии на кнопку?, инструкция не работает которая в шапке темы.
  3. как сделать фильтр по кнопке? в файле catalog/view/javascript/filterpro.min.js замените $("#filterpro .filtered").live("change", (function () { iF(); })); на $("#filterpro .filtered").live("change", (function () { return false; })); в шаблоне в любом удобном месте добавьте код (текст кнопки и стили можно задать какие угодно): <a onclick="iF()">Применить</a>.. Не помогает (, во первых сам фильтр на месте, я думал что при нажатии на кнопку он должен появляться, а во вторых меняется только ссылка, если была к примеру такая /mobilnye-telefony/ то после нажатия на кнопку /mobilnye-telefony/#category_id=59&page=0&path=59&sort=p.sort_order&order=ASC&limit=15&min_price=16&max_price=62 . Подскажите пожалуйста что делаю не правильно? P.s Выводил кнопку через модуль html блока, если что. Может нужно прямо в шаблоне?, только я не знаю в каком файле шаблона левый сайдбар для категорий.
  4. Нужны следующие модули, но не знаю названий, подскажите пожалуйста, кто знает, (только бесплатные) - чтобы в одном блоке вкладками(табами) выводились последние товары, рекомендуемые и т.д; - сделать возможность авто-слайдера или в ручную через стрелки для блоков последние товары, рекомендуемые т.д; - статусы у товаров как например у розетки ( http://rozetka.com.ua/notebooks/c80004/filter/preset=workteaching/ ) вывод картинками (иконками), на сколько гб товар, бренд и т.д; - вторая кнопка быстрого заказа, помимо просто кнопки - купить; - расположения для блоков помимо вверху,внизу, слева, справа. (или это только тему такую искать?) - обратный звонок. - слева блок - рекомендуем, как на сайте http://cosmio.com.ua/ , можно листать через стрелки (очень нужен!) Если для таких задач существуют модули, буду очень благодарен если подскажете какие.
  5. Тоже самое, при включённом Seo Pro sitemap.xml только по адресу index.php?route=feed/google_sitemap . Как исправить подскажите пожалуйста, ниже часть кода, вроде всё стандартно: RewriteBase / RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L] RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L] RewriteRule ^download/(.*) /index.php?route=error/not_found [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css) RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
  6. Проблема в следующем, меняется tpl или css при изменении опций в фильтре (см. скрин). В css прописал чтобы в разделе категорий при наведении на товар всплывал черный блок с информацией, что видно на скрине, так же сам div прописал в category.tpl, всё работает отлично, но если изменить опцию в сортировке, или в фильтрах то стиль пропадает, посмотрел через фаербаг, блок который прописывал в category.tpl, его больше не видно, будто при сортировке или изменении фильтров меняется темплейт и получается что блок где то не прописан, так и есть? Если да, то подскажите пожалуйста что это за файл, или как решить данную ситуацию?
  7. Спасибо гляну ), пока сделал полный бэкап, всё норм, но все равно раздражает наличие левых модулей, один только амазон занимает около 120 файлов.., надо как то выпилить всё лишнее, пойду на второй заход уже более внимательно ). Жаль нету какой то light версии опенкарта без всего лишнего. :cry:
  8. Глюк со страницей товаров в админке, контент уезжает вниз а вверху написано что страница не найдена (см. скрин). С категориями всё в порядке. Случилось после удаления полностью файлов модуля amazon.. вроде он вообще товары не затрагивает.. Подскажите пожалуйста в чём может быть причина, и какой файл отвечает за страницу товаров?
  9. Автор модуля расширил его функции, теперь можно добавлять h1 и title для товаров. Советую скачать, работает отлично! http://www.opencart.com/index.php?route=extension/extension/info&extension_id=15904&filter_username=Vlkombat
  10. Не могу понять в чём причина, почему в чистом опенкарт 1.5.6.4, со стандартной темой, этот модуль в категориях h1 и title добавляет а в товарах не хочет, посмотрел в бд, там в product_description есть поля meta_title и page_h1 так же как и в category_description, их похоже модуль туда автоматом прописывает, тогда в чём же дело, что ему не нравится в 224 и 236 строках, ведь всё работает по такому же принципу как и для категорий.. Плиз хелп! Ниже для удобства вставил код из xml уже переделанного для товаров и vq2-catalog_controller_product_product. UPD. Похоже конфликт возникает в файле /catalog/controller/product/product.php именно на 224 строке. Добавил ниже код этого файла. Готовый XML файл модуля для товаров <!--admin--> <file name="admin/view/template/catalog/product_form.tpl"> <operation> <search position="before"><![CDATA[<td><?php echo $entry_description; ?></td>]]></search> <add><![CDATA[ <td>Title (тайтл)</td> <td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][meta_title]" size="100" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['meta_title'] : ''; ?>" /> <?php if (isset($error_name[$language['language_id']])) { ?> <span class="error"><?php echo $error_name[$language['language_id']]; ?></span> <?php } ?></td></tr><tr> <td>H1</td> <td><input type="text" name="product_description[<?php echo $language['language_id']; ?>][page_h1]" size="100" value="<?php echo isset($product_description[$language['language_id']]) ? $product_description[$language['language_id']]['page_h1'] : ''; ?>" /> <?php if (isset($error_name[$language['language_id']])) { ?> <span class="error"><?php echo $error_name[$language['language_id']]; ?></span> <?php } ?></td> </tr> <tr> ]]></add> </operation> </file> <file name="admin/controller/catalog/product.php"> <operation> <search position="after"><![CDATA[ protected function getForm() { ]]></search> <add><![CDATA[ $query = $this->db->query("DESC ".DB_PREFIX."product_description meta_title"); if (!$query->num_rows) { $this->db->query("ALTER TABLE `" . DB_PREFIX . "product_description` ADD `meta_title` varchar(255) NOT NULL COMMENT '' COLLATE utf8_bin AFTER name;"); $this->db->query("ALTER TABLE `" . DB_PREFIX . "product_description` ADD `page_h1` varchar(255) NOT NULL COMMENT '' COLLATE utf8_bin AFTER meta_title;"); }]]></add> </operation> </file> <file name="admin/model/catalog/product.php"> <operation> <search position="replace"><![CDATA[$this->db->escape($value['meta_description']) . "',]]></search> <add><![CDATA[$this->db->escape($value['meta_description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', page_h1 = '" . $this->db->escape($value['page_h1']) . "',]]></add> </operation> <operation> <search position="after"><![CDATA[$product_description_data[$result['language_id']] = array(]]></search> <add><![CDATA[ 'meta_title' => $result['meta_title'], 'page_h1' => $result['page_h1'], ]]></add> </operation> </file> <!--catalog--> <file name="/catalog/controller/product/product.php"> <operation> <search position="replace"><![CDATA[$this->document->setTitle($product_info['name']);]]></search> <add trim="true"><![CDATA[if ($product_info['meta_title']) { $this->document->setTitle($product_info['meta_title']); } else { $this->document->setTitle($product_info['name']); }]]></add> </operation> <operation> <search position="replace"><![CDATA[$this->data['heading_title'] = $product_info['name'];]]></search> <add trim="true"><![CDATA[if ($product_info['page_h1']) { $this->data['heading_title'] = $product_info['page_h1']; } else { $this->data['heading_title'] = $product_info['name']; }]]></add> </operation> </file> </modification> product.php <?php class ControllerProductProduct extends Controller { private $error = array(); public function index() { $this->language->load('product/product'); $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false ); $this->load->model('catalog/category'); if (isset($this->request->get['path'])) { $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = $path_id; } else { $path .= '_' . $path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $this->data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path), 'separator' => $this->language->get('text_separator') ); } } // Set the last category breadcrumb $category_info = $this->model_catalog_category->getCategory($category_id); if ($category_info) { $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']; } $this->data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'].$url), 'separator' => $this->language->get('text_separator') ); } } $this->load->model('catalog/manufacturer'); if (isset($this->request->get['manufacturer_id'])) { $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_brand'), 'href' => $this->url->link('product/manufacturer'), 'separator' => $this->language->get('text_separator') ); $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']; } $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']); if ($manufacturer_info) { $this->data['breadcrumbs'][] = array( 'text' => $manufacturer_info['name'], 'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url), 'separator' => $this->language->get('text_separator') ); } } if (isset($this->request->get['search']) || isset($this->request->get['tag'])) { $url = ''; if (isset($this->request->get['search'])) { $url .= '&search=' . $this->request->get['search']; } if (isset($this->request->get['tag'])) { $url .= '&tag=' . $this->request->get['tag']; } if (isset($this->request->get['description'])) { $url .= '&description=' . $this->request->get['description']; } 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['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']; } $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_search'), 'href' => $this->url->link('product/search', $url), 'separator' => $this->language->get('text_separator') ); } if (isset($this->request->get['product_id'])) { $product_id = (int)$this->request->get['product_id']; } else { $product_id = 0; } $this->load->model('catalog/product'); $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { $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['manufacturer_id'])) { $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id']; } if (isset($this->request->get['search'])) { $url .= '&search=' . $this->request->get['search']; } if (isset($this->request->get['tag'])) { $url .= '&tag=' . $this->request->get['tag']; } if (isset($this->request->get['description'])) { $url .= '&description=' . $this->request->get['description']; } 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['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']; } $this->data['breadcrumbs'][] = array( 'text' => $product_info['name'], 'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']), 'separator' => $this->language->get('text_separator') ); $this->document->setTitle($product_info['name']); $this->document->setDescription($product_info['meta_description']); $this->document->setKeywords($product_info['meta_keyword']); $this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical'); $this->document->addScript('catalog/view/javascript/jquery/tabs.js'); $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js'); $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css'); $this->data['heading_title'] = $product_info['name']; $this->data['text_select'] = $this->language->get('text_select'); $this->data['text_manufacturer'] = $this->language->get('text_manufacturer'); $this->data['text_model'] = $this->language->get('text_model'); $this->data['text_reward'] = $this->language->get('text_reward'); $this->data['text_points'] = $this->language->get('text_points'); $this->data['text_discount'] = $this->language->get('text_discount'); $this->data['text_stock'] = $this->language->get('text_stock'); $this->data['text_price'] = $this->language->get('text_price'); $this->data['text_tax'] = $this->language->get('text_tax'); $this->data['text_discount'] = $this->language->get('text_discount'); $this->data['text_option'] = $this->language->get('text_option'); $this->data['text_qty'] = $this->language->get('text_qty'); $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']); $this->data['text_or'] = $this->language->get('text_or'); $this->data['text_write'] = $this->language->get('text_write'); $this->data['text_note'] = $this->language->get('text_note'); $this->data['text_share'] = $this->language->get('text_share'); $this->data['text_wait'] = $this->language->get('text_wait'); $this->data['text_tags'] = $this->language->get('text_tags'); $this->data['entry_name'] = $this->language->get('entry_name'); $this->data['entry_review'] = $this->language->get('entry_review'); $this->data['entry_rating'] = $this->language->get('entry_rating'); $this->data['entry_good'] = $this->language->get('entry_good'); $this->data['entry_bad'] = $this->language->get('entry_bad'); $this->data['entry_captcha'] = $this->language->get('entry_captcha'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->data['button_wishlist'] = $this->language->get('button_wishlist'); $this->data['button_compare'] = $this->language->get('button_compare'); $this->data['button_upload'] = $this->language->get('button_upload'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->load->model('catalog/review'); $this->data['tab_description'] = $this->language->get('tab_description'); $this->data['tab_attribute'] = $this->language->get('tab_attribute'); $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']); $this->data['tab_related'] = $this->language->get('tab_related'); $this->data['product_id'] = $this->request->get['product_id']; $this->data['manufacturer'] = $product_info['manufacturer']; $this->data['manufacturers'] = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $product_info['manufacturer_id']); $this->data['model'] = $product_info['model']; $this->data['reward'] = $product_info['reward']; $this->data['points'] = $product_info['points']; if ($product_info['quantity'] <= 0) { $this->data['stock'] = $product_info['stock_status']; } elseif ($this->config->get('config_stock_display')) { $this->data['stock'] = $product_info['quantity']; } else { $this->data['stock'] = $this->language->get('text_instock'); } $this->load->model('tool/image'); if ($product_info['image']) { $this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')); } else { $this->data['popup'] = ''; } if ($product_info['image']) { $this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')); } else { $this->data['thumb'] = ''; } $this->data['images'] = array(); $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']); foreach ($results as $result) { $this->data['images'][] = array( 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')), 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height')) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $this->data['price'] = false; } if ((float)$product_info['special']) { $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $this->data['special'] = false; } if ($this->config->get('config_tax')) { $this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']); } else { $this->data['tax'] = false; } $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']); $this->data['discounts'] = array(); foreach ($discounts as $discount) { $this->data['discounts'][] = array( 'quantity' => $discount['quantity'], 'price' => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) ); } $this->data['options'] = array(); foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') { $option_value_data = array(); foreach ($option['option_value'] as $option_value) { if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) { if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) { $price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } $option_value_data[] = array( 'product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->resize($option_value['image'], 50, 50), 'price' => $price, 'price_prefix' => $option_value['price_prefix'] ); } } $this->data['options'][] = array( 'product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'option_value' => $option_value_data, 'required' => $option['required'] ); } elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') { $this->data['options'][] = array( 'product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'option_value' => $option['option_value'], 'required' => $option['required'] ); } } if ($product_info['minimum']) { $this->data['minimum'] = $product_info['minimum']; } else { $this->data['minimum'] = 1; } $this->data['review_status'] = $this->config->get('config_review_status'); $this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']); $this->data['rating'] = (int)$product_info['rating']; $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8'); $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); $this->data['products'] = array(); $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height')); } else { $image = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']) ); } $this->data['tags'] = array(); if ($product_info['tag']) { $tags = explode(',', $product_info['tag']); foreach ($tags as $tag) { $this->data['tags'][] = array( 'tag' => trim($tag), 'href' => $this->url->link('product/search', 'tag=' . trim($tag)) ); } } $this->data['text_payment_profile'] = $this->language->get('text_payment_profile'); $this->data['profiles'] = $this->model_catalog_product->getProfiles($product_info['product_id']); $this->model_catalog_product->updateViewed($this->request->get['product_id']); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/product.tpl'; } else { $this->template = 'default/template/product/product.tpl'; } $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header' ); $this->response->setOutput($this->render()); } 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['manufacturer_id'])) { $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id']; } if (isset($this->request->get['search'])) { $url .= '&search=' . $this->request->get['search']; } if (isset($this->request->get['tag'])) { $url .= '&tag=' . $this->request->get['tag']; } if (isset($this->request->get['description'])) { $url .= '&description=' . $this->request->get['description']; } 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['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']; } $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/product', $url . '&product_id=' . $product_id), 'separator' => $this->language->get('text_separator') ); $this->document->setTitle($this->language->get('text_error')); $this->data['heading_title'] = $this->language->get('text_error'); $this->data['text_error'] = $this->language->get('text_error'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl'; } else { $this->template = 'default/template/error/not_found.tpl'; } $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header' ); $this->response->setOutput($this->render()); } } public function review() { $this->language->load('product/product'); $this->load->model('catalog/review'); $this->data['text_on'] = $this->language->get('text_on'); $this->data['text_no_reviews'] = $this->language->get('text_no_reviews'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $this->data['reviews'] = array(); $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']); $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5); foreach ($results as $result) { $this->data['reviews'][] = array( 'author' => $result['author'], 'text' => $result['text'], 'rating' => (int)$result['rating'], 'reviews' => sprintf($this->language->get('text_reviews'), (int)$review_total), 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])) ); } $pagination = new Pagination(); $pagination->total = $review_total; $pagination->page = $page; $pagination->limit = 5; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}'); $this->data['pagination'] = $pagination->render(); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/review.tpl'; } else { $this->template = 'default/template/product/review.tpl'; } $this->response->setOutput($this->render()); } public function getRecurringDescription() { $this->language->load('product/product'); $this->load->model('catalog/product'); if (isset($this->request->post['product_id'])) { $product_id = $this->request->post['product_id']; } else { $product_id = 0; } if (isset($this->request->post['profile_id'])) { $profile_id = $this->request->post['profile_id']; } else { $profile_id = 0; } if (isset($this->request->post['quantity'])) { $quantity = $this->request->post['quantity']; } else { $quantity = 1; } $product_info = $this->model_catalog_product->getProduct($product_id); $profile_info = $this->model_catalog_product->getProfile($product_id, $profile_id); $json = array(); if ($product_info && $profile_info) { if (!$json) { $frequencies = array( 'day' => $this->language->get('text_day'), 'week' => $this->language->get('text_week'), 'semi_month' => $this->language->get('text_semi_month'), 'month' => $this->language->get('text_month'), 'year' => $this->language->get('text_year'), ); if ($profile_info['trial_status'] == 1) { $price = $this->currency->format($this->tax->calculate($profile_info['trial_price'] * $quantity, $product_info['tax_class_id'], $this->config->get('config_tax'))); $trial_text = sprintf($this->language->get('text_trial_description'), $price, $profile_info['trial_cycle'], $frequencies[$profile_info['trial_frequency']], $profile_info['trial_duration']) . ' '; } else { $trial_text = ''; } $price = $this->currency->format($this->tax->calculate($profile_info['price'] * $quantity, $product_info['tax_class_id'], $this->config->get('config_tax'))); if ($profile_info['duration']) { $text = $trial_text . sprintf($this->language->get('text_payment_description'), $price, $profile_info['cycle'], $frequencies[$profile_info['frequency']], $profile_info['duration']); } else { $text = $trial_text . sprintf($this->language->get('text_payment_until_canceled_description'), $price, $profile_info['cycle'], $frequencies[$profile_info['frequency']], $profile_info['duration']); } $json['success'] = $text; } } $this->response->setOutput(json_encode($json)); } public function write() { $this->language->load('product/product'); $this->load->model('catalog/review'); $json = array(); if ($this->request->server['REQUEST_METHOD'] == 'POST') { if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) { $json['error'] = $this->language->get('error_name'); } if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) { $json['error'] = $this->language->get('error_text'); } if (empty($this->request->post['rating'])) { $json['error'] = $this->language->get('error_rating'); } if (empty($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) { $json['error'] = $this->language->get('error_captcha'); } if (!isset($json['error'])) { $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post); $json['success'] = $this->language->get('text_success'); } } $this->response->setOutput(json_encode($json)); } public function captcha() { $this->load->library('captcha'); $captcha = new Captcha(); $this->session->data['captcha'] = $captcha->getCode(); $captcha->showImage(); } public function upload() { $this->language->load('product/product'); $json = array(); if (!empty($this->request->files['file']['name'])) { $filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'))); if ((utf8_strlen($filename) < 3) || (utf8_strlen($filename) > 64)) { $json['error'] = $this->language->get('error_filename'); } // Allowed file extension types $allowed = array(); $filetypes = explode("\n", $this->config->get('config_file_extension_allowed')); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) { $json['error'] = $this->language->get('error_filetype'); } // Allowed file mime types $allowed = array(); $filetypes = explode("\n", $this->config->get('config_file_mime_allowed')); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array($this->request->files['file']['type'], $allowed)) { $json['error'] = $this->language->get('error_filetype'); } // Check to see if any PHP files are trying to be uploaded $content = file_get_contents($this->request->files['file']['tmp_name']); if (preg_match('/\<\?php/i', $content)) { $json['error'] = $this->language->get('error_filetype'); } if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) { $json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']); } } else { $json['error'] = $this->language->get('error_upload'); } if (!$json && is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) { $file = basename($filename) . '.' . md5(mt_rand()); // Hide the uploaded file name so people can not link to it directly. $json['file'] = $this->encryption->encrypt($file); move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file); $json['success'] = $this->language->get('text_upload'); } $this->response->setOutput(json_encode($json)); } } ?> vq2-catalog_controller_product_product <?php class ControllerProductProduct extends Controller { private $error = array(); public function index() { $this->language->load('product/product'); $this->data['breadcrumbs'] = array(); $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_home'), 'href' => $this->url->link('common/home'), 'separator' => false ); $this->load->model('catalog/category'); if (isset($this->request->get['path'])) { $path = ''; $parts = explode('_', (string)$this->request->get['path']); $category_id = (int)array_pop($parts); foreach ($parts as $path_id) { if (!$path) { $path = $path_id; } else { $path .= '_' . $path_id; } $category_info = $this->model_catalog_category->getCategory($path_id); if ($category_info) { $this->data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $path), 'separator' => $this->language->get('text_separator') ); } } // Set the last category breadcrumb $category_info = $this->model_catalog_category->getCategory($category_id); if ($category_info) { $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']; } $this->data['breadcrumbs'][] = array( 'text' => $category_info['name'], 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'].$url), 'separator' => $this->language->get('text_separator') ); } } $this->load->model('catalog/manufacturer'); if (isset($this->request->get['manufacturer_id'])) { $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_brand'), 'href' => $this->url->link('product/manufacturer'), 'separator' => $this->language->get('text_separator') ); $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']; } $manufacturer_info = $this->model_catalog_manufacturer->getManufacturer($this->request->get['manufacturer_id']); if ($manufacturer_info) { $this->data['breadcrumbs'][] = array( 'text' => $manufacturer_info['name'], 'href' => $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $this->request->get['manufacturer_id'] . $url), 'separator' => $this->language->get('text_separator') ); } } if (isset($this->request->get['search']) || isset($this->request->get['tag'])) { $url = ''; if (isset($this->request->get['search'])) { $url .= '&search=' . $this->request->get['search']; } if (isset($this->request->get['tag'])) { $url .= '&tag=' . $this->request->get['tag']; } if (isset($this->request->get['description'])) { $url .= '&description=' . $this->request->get['description']; } 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['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']; } $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_search'), 'href' => $this->url->link('product/search', $url), 'separator' => $this->language->get('text_separator') ); } if (isset($this->request->get['product_id'])) { $product_id = (int)$this->request->get['product_id']; } else { $product_id = 0; } $this->load->model('catalog/product'); $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { $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['manufacturer_id'])) { $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id']; } if (isset($this->request->get['search'])) { $url .= '&search=' . $this->request->get['search']; } if (isset($this->request->get['tag'])) { $url .= '&tag=' . $this->request->get['tag']; } if (isset($this->request->get['description'])) { $url .= '&description=' . $this->request->get['description']; } 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['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']; } $this->data['breadcrumbs'][] = array( 'text' => $product_info['name'], 'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id']), 'separator' => $this->language->get('text_separator') ); if ($product_info['meta_title']) { $this->document->setTitle($product_info['meta_title']); } else { $this->document->setTitle($product_info['name']); } $this->document->setDescription($product_info['meta_description']); $this->document->setKeywords($product_info['meta_keyword']); $this->document->addLink($this->url->link('product/product', 'product_id=' . $this->request->get['product_id']), 'canonical'); $this->document->addScript('catalog/view/javascript/jquery/tabs.js'); $this->document->addScript('catalog/view/javascript/jquery/colorbox/jquery.colorbox-min.js'); $this->document->addStyle('catalog/view/javascript/jquery/colorbox/colorbox.css'); if ($product_info['page_h1']) { $this->data['heading_title'] = $product_info['page_h1']; } else { $this->data['heading_title'] = $product_info['name']; } $this->data['text_select'] = $this->language->get('text_select'); $this->data['text_manufacturer'] = $this->language->get('text_manufacturer'); $this->data['text_model'] = $this->language->get('text_model'); $this->data['text_reward'] = $this->language->get('text_reward'); $this->data['text_points'] = $this->language->get('text_points'); $this->data['text_discount'] = $this->language->get('text_discount'); $this->data['text_stock'] = $this->language->get('text_stock'); $this->data['text_price'] = $this->language->get('text_price'); $this->data['text_tax'] = $this->language->get('text_tax'); $this->data['text_discount'] = $this->language->get('text_discount'); $this->data['text_option'] = $this->language->get('text_option'); $this->data['text_qty'] = $this->language->get('text_qty'); $this->data['text_minimum'] = sprintf($this->language->get('text_minimum'), $product_info['minimum']); $this->data['text_or'] = $this->language->get('text_or'); $this->data['text_write'] = $this->language->get('text_write'); $this->data['text_note'] = $this->language->get('text_note'); $this->data['text_share'] = $this->language->get('text_share'); $this->data['text_wait'] = $this->language->get('text_wait'); $this->data['text_tags'] = $this->language->get('text_tags'); $this->data['entry_name'] = $this->language->get('entry_name'); $this->data['entry_review'] = $this->language->get('entry_review'); $this->data['entry_rating'] = $this->language->get('entry_rating'); $this->data['entry_good'] = $this->language->get('entry_good'); $this->data['entry_bad'] = $this->language->get('entry_bad'); $this->data['entry_captcha'] = $this->language->get('entry_captcha'); $this->data['button_cart'] = $this->language->get('button_cart'); $this->data['button_wishlist'] = $this->language->get('button_wishlist'); $this->data['button_compare'] = $this->language->get('button_compare'); $this->data['button_upload'] = $this->language->get('button_upload'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->load->model('catalog/review'); $this->data['tab_description'] = $this->language->get('tab_description'); $this->data['tab_attribute'] = $this->language->get('tab_attribute'); $this->data['tab_review'] = sprintf($this->language->get('tab_review'), $product_info['reviews']); $this->data['tab_related'] = $this->language->get('tab_related'); $this->data['product_id'] = $this->request->get['product_id']; $this->data['manufacturer'] = $product_info['manufacturer']; $this->data['manufacturers'] = $this->url->link('product/manufacturer/info', 'manufacturer_id=' . $product_info['manufacturer_id']); $this->data['model'] = $product_info['model']; $this->data['reward'] = $product_info['reward']; $this->data['points'] = $product_info['points']; if ($product_info['quantity'] <= 0) { $this->data['stock'] = $product_info['stock_status']; } elseif ($this->config->get('config_stock_display')) { $this->data['stock'] = $product_info['quantity']; } else { $this->data['stock'] = $this->language->get('text_instock'); } $this->load->model('tool/image'); if ($product_info['image']) { $this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')); } else { $this->data['popup'] = ''; } if ($product_info['image']) { $this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height')); } else { $this->data['thumb'] = ''; } $this->data['images'] = array(); $results = $this->model_catalog_product->getProductImages($this->request->get['product_id']); foreach ($results as $result) { $this->data['images'][] = array( 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')), 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height')) ); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $this->data['price'] = false; } if ((float)$product_info['special']) { $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $this->data['special'] = false; } if ($this->config->get('config_tax')) { $this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']); } else { $this->data['tax'] = false; } $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']); $this->data['discounts'] = array(); foreach ($discounts as $discount) { $this->data['discounts'][] = array( 'quantity' => $discount['quantity'], 'price' => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) ); } $this->data['options'] = array(); foreach ($this->model_catalog_product->getProductOptions($this->request->get['product_id']) as $option) { if ($option['type'] == 'select' || $option['type'] == 'radio' || $option['type'] == 'checkbox' || $option['type'] == 'image') { $option_value_data = array(); foreach ($option['option_value'] as $option_value) { if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) { if ((($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) && (float)$option_value['price']) { $price = $this->currency->format($this->tax->calculate($option_value['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } $option_value_data[] = array( 'product_option_value_id' => $option_value['product_option_value_id'], 'option_value_id' => $option_value['option_value_id'], 'name' => $option_value['name'], 'image' => $this->model_tool_image->resize($option_value['image'], 50, 50), 'price' => $price, 'price_prefix' => $option_value['price_prefix'] ); } } $this->data['options'][] = array( 'product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'option_value' => $option_value_data, 'required' => $option['required'] ); } elseif ($option['type'] == 'text' || $option['type'] == 'textarea' || $option['type'] == 'file' || $option['type'] == 'date' || $option['type'] == 'datetime' || $option['type'] == 'time') { $this->data['options'][] = array( 'product_option_id' => $option['product_option_id'], 'option_id' => $option['option_id'], 'name' => $option['name'], 'type' => $option['type'], 'option_value' => $option['option_value'], 'required' => $option['required'] ); } } if ($product_info['minimum']) { $this->data['minimum'] = $product_info['minimum']; } else { $this->data['minimum'] = 1; } $this->data['review_status'] = $this->config->get('config_review_status'); $this->data['reviews'] = sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']); $this->data['rating'] = (int)$product_info['rating']; $this->data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8'); $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); $this->data['products'] = array(); $results = $this->model_catalog_product->getProductRelated($this->request->get['product_id']); foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height')); } else { $image = false; } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = (int)$result['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'name' => $result['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']) ); } $this->data['tags'] = array(); if ($product_info['tag']) { $tags = explode(',', $product_info['tag']); foreach ($tags as $tag) { $this->data['tags'][] = array( 'tag' => trim($tag), 'href' => $this->url->link('product/search', 'tag=' . trim($tag)) ); } } $this->data['text_payment_profile'] = $this->language->get('text_payment_profile'); $this->data['profiles'] = $this->model_catalog_product->getProfiles($product_info['product_id']); $this->model_catalog_product->updateViewed($this->request->get['product_id']); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/product.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/product.tpl'; } else { $this->template = 'default/template/product/product.tpl'; } $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header' ); $this->response->setOutput($this->render()); } 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['manufacturer_id'])) { $url .= '&manufacturer_id=' . $this->request->get['manufacturer_id']; } if (isset($this->request->get['search'])) { $url .= '&search=' . $this->request->get['search']; } if (isset($this->request->get['tag'])) { $url .= '&tag=' . $this->request->get['tag']; } if (isset($this->request->get['description'])) { $url .= '&description=' . $this->request->get['description']; } 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['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']; } $this->data['breadcrumbs'][] = array( 'text' => $this->language->get('text_error'), 'href' => $this->url->link('product/product', $url . '&product_id=' . $product_id), 'separator' => $this->language->get('text_separator') ); $this->document->setTitle($this->language->get('text_error')); $this->data['heading_title'] = $this->language->get('text_error'); $this->data['text_error'] = $this->language->get('text_error'); $this->data['button_continue'] = $this->language->get('button_continue'); $this->data['continue'] = $this->url->link('common/home'); $this->response->addHeader($this->request->server['SERVER_PROTOCOL'] . '/1.1 404 Not Found'); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/error/not_found.tpl')) { $this->template = $this->config->get('config_template') . '/template/error/not_found.tpl'; } else { $this->template = 'default/template/error/not_found.tpl'; } $this->children = array( 'common/column_left', 'common/column_right', 'common/content_top', 'common/content_bottom', 'common/footer', 'common/header' ); $this->response->setOutput($this->render()); } } public function review() { $this->language->load('product/product'); $this->load->model('catalog/review'); $this->data['text_on'] = $this->language->get('text_on'); $this->data['text_no_reviews'] = $this->language->get('text_no_reviews'); if (isset($this->request->get['page'])) { $page = $this->request->get['page']; } else { $page = 1; } $this->data['reviews'] = array(); $review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']); $results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5); foreach ($results as $result) { $this->data['reviews'][] = array( 'author' => $result['author'], 'text' => $result['text'], 'rating' => (int)$result['rating'], 'reviews' => sprintf($this->language->get('text_reviews'), (int)$review_total), 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])) ); } $pagination = new Pagination(); $pagination->total = $review_total; $pagination->page = $page; $pagination->limit = 5; $pagination->text = $this->language->get('text_pagination'); $pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}'); $this->data['pagination'] = $pagination->render(); if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/review.tpl')) { $this->template = $this->config->get('config_template') . '/template/product/review.tpl'; } else { $this->template = 'default/template/product/review.tpl'; } $this->response->setOutput($this->render()); } public function getRecurringDescription() { $this->language->load('product/product'); $this->load->model('catalog/product'); if (isset($this->request->post['product_id'])) { $product_id = $this->request->post['product_id']; } else { $product_id = 0; } if (isset($this->request->post['profile_id'])) { $profile_id = $this->request->post['profile_id']; } else { $profile_id = 0; } if (isset($this->request->post['quantity'])) { $quantity = $this->request->post['quantity']; } else { $quantity = 1; } $product_info = $this->model_catalog_product->getProduct($product_id); $profile_info = $this->model_catalog_product->getProfile($product_id, $profile_id); $json = array(); if ($product_info && $profile_info) { if (!$json) { $frequencies = array( 'day' => $this->language->get('text_day'), 'week' => $this->language->get('text_week'), 'semi_month' => $this->language->get('text_semi_month'), 'month' => $this->language->get('text_month'), 'year' => $this->language->get('text_year'), ); if ($profile_info['trial_status'] == 1) { $price = $this->currency->format($this->tax->calculate($profile_info['trial_price'] * $quantity, $product_info['tax_class_id'], $this->config->get('config_tax'))); $trial_text = sprintf($this->language->get('text_trial_description'), $price, $profile_info['trial_cycle'], $frequencies[$profile_info['trial_frequency']], $profile_info['trial_duration']) . ' '; } else { $trial_text = ''; } $price = $this->currency->format($this->tax->calculate($profile_info['price'] * $quantity, $product_info['tax_class_id'], $this->config->get('config_tax'))); if ($profile_info['duration']) { $text = $trial_text . sprintf($this->language->get('text_payment_description'), $price, $profile_info['cycle'], $frequencies[$profile_info['frequency']], $profile_info['duration']); } else { $text = $trial_text . sprintf($this->language->get('text_payment_until_canceled_description'), $price, $profile_info['cycle'], $frequencies[$profile_info['frequency']], $profile_info['duration']); } $json['success'] = $text; } } $this->response->setOutput(json_encode($json)); } public function write() { $this->language->load('product/product'); $this->load->model('catalog/review'); $json = array(); if ($this->request->server['REQUEST_METHOD'] == 'POST') { if ((utf8_strlen($this->request->post['name']) < 3) || (utf8_strlen($this->request->post['name']) > 25)) { $json['error'] = $this->language->get('error_name'); } if ((utf8_strlen($this->request->post['text']) < 25) || (utf8_strlen($this->request->post['text']) > 1000)) { $json['error'] = $this->language->get('error_text'); } if (empty($this->request->post['rating'])) { $json['error'] = $this->language->get('error_rating'); } if (empty($this->session->data['captcha']) || ($this->session->data['captcha'] != $this->request->post['captcha'])) { $json['error'] = $this->language->get('error_captcha'); } if (!isset($json['error'])) { $this->model_catalog_review->addReview($this->request->get['product_id'], $this->request->post); $json['success'] = $this->language->get('text_success'); } } $this->response->setOutput(json_encode($json)); } public function captcha() { $this->load->library('captcha'); $captcha = new Captcha(); $this->session->data['captcha'] = $captcha->getCode(); $captcha->showImage(); } public function upload() { $this->language->load('product/product'); $json = array(); if (!empty($this->request->files['file']['name'])) { $filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($this->request->files['file']['name'], ENT_QUOTES, 'UTF-8'))); if ((utf8_strlen($filename) < 3) || (utf8_strlen($filename) > 64)) { $json['error'] = $this->language->get('error_filename'); } // Allowed file extension types $allowed = array(); $filetypes = explode("\n", $this->config->get('config_file_extension_allowed')); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) { $json['error'] = $this->language->get('error_filetype'); } // Allowed file mime types $allowed = array(); $filetypes = explode("\n", $this->config->get('config_file_mime_allowed')); foreach ($filetypes as $filetype) { $allowed[] = trim($filetype); } if (!in_array($this->request->files['file']['type'], $allowed)) { $json['error'] = $this->language->get('error_filetype'); } // Check to see if any PHP files are trying to be uploaded $content = file_get_contents($this->request->files['file']['tmp_name']); if (preg_match('/\<\?php/i', $content)) { $json['error'] = $this->language->get('error_filetype'); } if ($this->request->files['file']['error'] != UPLOAD_ERR_OK) { $json['error'] = $this->language->get('error_upload_' . $this->request->files['file']['error']); } } else { $json['error'] = $this->language->get('error_upload'); } if (!$json && is_uploaded_file($this->request->files['file']['tmp_name']) && file_exists($this->request->files['file']['tmp_name'])) { $file = basename($filename) . '.' . md5(mt_rand()); // Hide the uploaded file name so people can not link to it directly. $json['file'] = $this->encryption->encrypt($file); move_uploaded_file($this->request->files['file']['tmp_name'], DIR_DOWNLOAD . $file); $json['success'] = $this->language->get('text_upload'); } $this->response->setOutput(json_encode($json)); } } ?>
  11. А мы против сборок ), только оригинальный продукт уважаем 8-) . Ох.. сколько я намучился с SeoPro и дублями, и у меня тоже 1.5.6.4. Вот 100% рабочий метод!, мне помог как видно дальше в теме.
  12. Много сил и времени вложено в настройку уже того что есть, думаю новички меня поймут ). Это последняя задача которая осталась перед запуском магазина, очень надеюсь на помощь неравнодушных )
  13. На Opencart 1.5.6.4 установил модуль (см. код, всего 1 xml), всё работает отлично, но единственный его минус это то, что он только в категории добавляет поля h1 и title, а мне нужно и для товаров. Методом сравнения, продублировал код в данном файле и везде где пишется category заменил на product. В итоге на страницах товаров вверху выдаёт: Notice: Undefined index: meta_title in V:\home\test.com.ua\www\vqmod\vqcache\vq2-catalog_controller_product_product.php on line 224Notice: Undefined index: page_h1 in V:\home\test.com.ua\www\vqmod\vqcache\vq2-catalog_controller_product_product.php on line 236 , и h1 и title не работают но в админке поля есть. Пытался что то изменить и в xml файле и в vq2-catalog_controller_product_product.php , безрезультатно. Пожалуйста, кому не сложно, протестируйте у себя, всего один этот файл, чтоб он работал и для товаров. Думаю, у специалиста это займет не много времени, а в итоге поможет многим людям кто будет заходить в эту тему по той же причине по которой я её создал. Заранее большое спасибо! <modification> <id>catalog meta title, h1</id> <version>1.1</version> <vqmver>2.1.7</vqmver> <author>vlkombat - http://httpmaster.ru/</author> <!--admin--> <file name="admin/view/template/catalog/category_form.tpl"> <operation> <search position="before"><![CDATA[<td><?php echo $entry_description; ?></td>]]></search> <add><![CDATA[ <td>Title (тайтл)</td> <td><input type="text" name="category_description[<?php echo $language['language_id']; ?>][meta_title]" size="100" value="<?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['meta_title'] : ''; ?>" /> <?php if (isset($error_name[$language['language_id']])) { ?> <span class="error"><?php echo $error_name[$language['language_id']]; ?></span> <?php } ?></td></tr><tr> <td>H1</td> <td><input type="text" name="category_description[<?php echo $language['language_id']; ?>][page_h1]" size="100" value="<?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['page_h1'] : ''; ?>" /> <?php if (isset($error_name[$language['language_id']])) { ?> <span class="error"><?php echo $error_name[$language['language_id']]; ?></span> <?php } ?></td> </tr> <tr> ]]></add> </operation> </file> <file name="admin/controller/catalog/category.php"> <operation> <search position="after"><![CDATA[ protected function getForm() { ]]></search> <add><![CDATA[ $query = $this->db->query("DESC ".DB_PREFIX."category_description meta_title"); if (!$query->num_rows) { $this->db->query("ALTER TABLE `" . DB_PREFIX . "category_description` ADD `meta_title` varchar(255) NOT NULL COMMENT '' COLLATE utf8_bin AFTER name;"); $this->db->query("ALTER TABLE `" . DB_PREFIX . "category_description` ADD `page_h1` varchar(255) NOT NULL COMMENT '' COLLATE utf8_bin AFTER meta_title;"); }]]></add> </operation> </file> <file name="admin/model/catalog/category.php"> <operation> <search position="replace"><![CDATA[$this->db->escape($value['meta_description']) . "',]]></search> <add><![CDATA[$this->db->escape($value['meta_description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', page_h1 = '" . $this->db->escape($value['page_h1']) . "',]]></add> </operation> <operation> <search position="after"><![CDATA[$category_description_data[$result['language_id']] = array(]]></search> <add><![CDATA[ 'meta_title' => $result['meta_title'], 'page_h1' => $result['page_h1'], ]]></add> </operation> </file> <!--catalog--> <file name="/catalog/controller/product/category.php"> <operation> <search position="replace"><![CDATA[$this->document->setTitle($category_info['name']);]]></search> <add trim="true"><![CDATA[if ($category_info['meta_title']) { $this->document->setTitle($category_info['meta_title']); } else { $this->document->setTitle($category_info['name']); }]]></add> </operation> <operation> <search position="replace"><![CDATA[$this->data['heading_title'] = $category_info['name'];]]></search> <add trim="true"><![CDATA[if ($category_info['page_h1']) { $this->data['heading_title'] = $category_info['page_h1']; } else { $this->data['heading_title'] = $category_info['name']; }]]></add> </operation> </file> </modification> catalog_meta_title.xml
  14. Установил модуль (см. код, всего 1 xml), всё работает отлично, но единственный его минус это то, что он только в категории добавляет поля h1 и title, а мне нужно и для товаров. Методом сравнения, продублировал код в данном файле и везде где пишется category заменил на product. В итоге на страницах товаров вверху выдаёт: Notice: Undefined index: meta_title in V:\home\test.com.ua\www\vqmod\vqcache\vq2-catalog_controller_product_product.php on line 224Notice: Undefined index: page_h1 in V:\home\test.com.ua\www\vqmod\vqcache\vq2-catalog_controller_product_product.php on line 236 , и h1 и title не работают но в админке поля есть. Пытался что то изменить и в xml файле и в vq2-catalog_controller_product_product.php , безрезультатно. Пожалуйста, кому не сложно, протестируйте у себя, всего один этот файл, чтоб он работал и для товаров. Думаю, у специалиста это займет не много времени, а в итоге поможет многим людям кто будет заходить в эту тему по той же причине по которой я её создал. Заранее большое спасибо! <modification> <id>catalog meta title, h1</id> <version>1.1</version> <vqmver>2.1.7</vqmver> <author>vlkombat - http://httpmaster.ru/</author> <!--admin--> <file name="admin/view/template/catalog/category_form.tpl"> <operation> <search position="before"><![CDATA[<td><?php echo $entry_description; ?></td>]]></search> <add><![CDATA[ <td>Title (тайтл)</td> <td><input type="text" name="category_description[<?php echo $language['language_id']; ?>][meta_title]" size="100" value="<?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['meta_title'] : ''; ?>" /> <?php if (isset($error_name[$language['language_id']])) { ?> <span class="error"><?php echo $error_name[$language['language_id']]; ?></span> <?php } ?></td></tr><tr> <td>H1</td> <td><input type="text" name="category_description[<?php echo $language['language_id']; ?>][page_h1]" size="100" value="<?php echo isset($category_description[$language['language_id']]) ? $category_description[$language['language_id']]['page_h1'] : ''; ?>" /> <?php if (isset($error_name[$language['language_id']])) { ?> <span class="error"><?php echo $error_name[$language['language_id']]; ?></span> <?php } ?></td> </tr> <tr> ]]></add> </operation> </file> <file name="admin/controller/catalog/category.php"> <operation> <search position="after"><![CDATA[ protected function getForm() { ]]></search> <add><![CDATA[ $query = $this->db->query("DESC ".DB_PREFIX."category_description meta_title"); if (!$query->num_rows) { $this->db->query("ALTER TABLE `" . DB_PREFIX . "category_description` ADD `meta_title` varchar(255) NOT NULL COMMENT '' COLLATE utf8_bin AFTER name;"); $this->db->query("ALTER TABLE `" . DB_PREFIX . "category_description` ADD `page_h1` varchar(255) NOT NULL COMMENT '' COLLATE utf8_bin AFTER meta_title;"); }]]></add> </operation> </file> <file name="admin/model/catalog/category.php"> <operation> <search position="replace"><![CDATA[$this->db->escape($value['meta_description']) . "',]]></search> <add><![CDATA[$this->db->escape($value['meta_description']) . "', meta_title = '" . $this->db->escape($value['meta_title']) . "', page_h1 = '" . $this->db->escape($value['page_h1']) . "',]]></add> </operation> <operation> <search position="after"><![CDATA[$category_description_data[$result['language_id']] = array(]]></search> <add><![CDATA[ 'meta_title' => $result['meta_title'], 'page_h1' => $result['page_h1'], ]]></add> </operation> </file> <!--catalog--> <file name="/catalog/controller/product/category.php"> <operation> <search position="replace"><![CDATA[$this->document->setTitle($category_info['name']);]]></search> <add trim="true"><![CDATA[if ($category_info['meta_title']) { $this->document->setTitle($category_info['meta_title']); } else { $this->document->setTitle($category_info['name']); }]]></add> </operation> <operation> <search position="replace"><![CDATA[$this->data['heading_title'] = $category_info['name'];]]></search> <add trim="true"><![CDATA[if ($category_info['page_h1']) { $this->data['heading_title'] = $category_info['page_h1']; } else { $this->data['heading_title'] = $category_info['name']; }]]></add> </operation> </file> </modification>
  15. Если я Вам ещё не надоел :-) , помогите пожалуйста ещё советом, ситуация в следующем, когда в футере перехожу на страницу производителей то адрес такой http://test.ru/brands/ и крошки Главная » Производители, там к примеру перехожу по бренду Apple и открывается адрес http://test.ru/apple.html а крошки Главная » Производители » Apple, почему в адресе пропадает /brands/ так и должно быть или нет? вроде в крошках показывается Производители а из адреса пропадает, я думал должно получатся http://test.ru/brands/apple.html хм.. не пойму почему так. Через поиск нашёл, что 1 человек уже задавался подобным вопросом, но ему никто не ответил :cry: https://opencartforum.com/topic/10270-%D0%B4%D1%83%D0%B1%D0%BB%D0%B8-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86-seopro/page-40#entry228296 https://opencartforum.com/topic/10270-%D0%B4%D1%83%D0%B1%D0%BB%D0%B8-%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86-seopro/page-34#entry202541
  16. CODEONETEAM, спасибо Вам большое за помощь, очень выручили! )
  17. Спасибо!, точно, теперь всё работает отлично ). Это нужно теперь после каждых изменений в админке чистить папку system/cache ? можно ли как то её автоматизировать, или все тоже чистят вручную ?
  18. Сделал, что то изменилось в лучшую сторону, что то в худшую, расскажу подробнее: 1. что в лучшую, пропали как я понял дубли :eek: , к примеру если раньше был url http://test.ru/phones/iphone-5.html, и когда убирал категорию phones чтоб было http://test.ru/iphone-5.html то все равно открывалась страница с айфоном, теперь когда убираю то страница перезагружается с полным адресом где есть категория, верно, там и должно быть ? как я понял теперь нет дубля ) 2. что в худшую, чпу перестали работать в новых созданых товарах и категориях , теперь выглядит так http://test.ru/index.php?route=product/product&path=69&product_id=59, хотя в SEO Keyword товара указываю iphone-5.html. В чем может быть причина? Не связано ли с тем что в 7 пункте инструкции, там где несколько строк INSERT INTO oc_url_alias я поубирал oc_ т.к у меня нет префикса, верно ?
  19. Мне тоже смешно что с дублями не могу разобраться ) но и грустно одновременно.. Ставил сеопро, дубли не пропали, и настройки разные пробовал, если не затруднит, укажите пожалуйста на работоспособную инструкцию как и что настроить и какой файл качать, может я не то скачал.. у меня опенкарт оригинальный 1.5.6.4 , скачивал vQmod opencart_v1.5.4
  20. Понял, спасибо. А есть ли какой то способ без модуля сеопро убрать дубли, или можно ли как то редирект сделать или 404 ?
  21. Просто seopro который можно скачать в данной теме ( не модуль seopro!) не избавляет от дублей а только делает нормальный url, верно?

×
×
  • Создать...

Важная информация

На нашем сайте используются файлы cookie и происходит обработка некоторых персональных данных пользователей, чтобы улучшить пользовательский интерфейс. Чтобы узнать для чего и какие персональные данные мы обрабатываем перейдите по ссылке. Если Вы нажмете «Я даю согласие», это означает, что Вы понимаете и принимаете все условия, указанные в этом Уведомлении о Конфиденциальности.