Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Wenceslaus

Новичок
  
  • Posts

    23
  • Joined

  • Last visited

1 Follower

About Wenceslaus

  • Birthday 06/12/1997

Информация

  • Пол
    Мужлина
  • Город:
    Харьков

Recent Profile Visitors

915 profile views

Wenceslaus's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Обнаружил проблему. Опенкарт 2.0.1.1. Добавил к товару USB флэш-накопитель:Suntrsi 16 ГБ сопутствующий товар Bluetooth гарнитура: S530. Всё отлично выводится, но вот потом я захожу в Bluetooth гарнитура: S530 и покупаю товар, и вот что получается: Что один и тот же товар в корзине и в блоке "Вам икже может пригодиться". Как исправить, что если товар находится в корзине, он не появится в нижнем блоке? Срочно, заранее спасипотому что!
  2. Добрый гдень! Сайт http://avtonota.com.ua/ Можно ли чтобы ссылки товара были категория/подкатегория/товар? В админке ик и высивлено - ЧПУ товаров с категориями - Да. Но на сайте отображается как главная категория/товар. Прикрепляю Seopro файл - Опенкарт 2.1.0.2 Очень нагдеюсь на Вашу помощь! Заранее спасипотому что! seo_pro.php
  3. Попропотому чтовал и ручную, и автоматическую усиновку, всё равно ошибки (а именно в категориях и ситьях только ) В чём может быть проблема? :(
  4. Добрый гдень. Опенкарт v. 2.1.0.2. При включении модуля и добавления шаблонов появляется ошибка Notice: Undefined variable: seogenerator in /home/380987772878/data/public_html/system/storage/modification/catalog/controller/product/category.php on line 191 Пример http://sofdi.dp.ua/oplata-dostavka Заранее спасипотому что!
  5. Почти сгделал, но одна проблема, помогите !! Категории и товары сили выводиться, в order_form.tpl добавил: <table class="list"> <tr> <td><?php echo $entry_add_product; ?><br/> <table> <tr> <td style="padding: 0;" colspan="3"><select id="category" style="margin-bottom: 5px;" onchange="getProducts();"> <?php foreach ($categories as $category) { ?> <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option> <?php } ?> </select></td> </tr> <tr> <td style="padding: 0;"> <select multiple="multiple" id="product1" size="10" style="width: 500px;"> </select> </td> <td style="vertical-align: middle;"><span class="add" onclick="addProduct();">Добавить товар</span></td> </tr> </table> </tr> </table> И на эти поля и кнопку повесил скрипты: <script type="text/javascript"><!-- var product_row = <?php echo $product_row; ?>; function addProduct() { $('#product1 :selected').each(function() { html = '<tbody id="product_' + product_row + '">'; html += '<tr>'; html += '<td class="left">'; html += '<input type="hidden" name="product[' + product_row + '][product_id]" value="' + $(this).attr('value') + '">'; html += '<span onclick="$(\'#product_' + product_row + '\').remove();" class="remove"> </span>'; html += '<a href="<?php echo HTTPS_SERVER . 'index.php?route=catalog/product/update&product_id='; ?>' + $(this).attr('value') + '&token=<?php echo $token; ?>">' + $(this).attr('text') + '</a>'; html += '</td>'; html += '<td class="right"><input type="text" name="product[' + product_row + '][quantity]" value="" size="4" /></td>'; html += '<td class="right"><input type="text" name="product[' + product_row + '][price]" value="" /></td>'; html += '<td class="right"><input type="text" name="product[' + product_row + '][total]" value="" /></td>'; html += '</tr>'; html += '</tbody>'; $('#totals').before(html); product_row++; }); } //--></script> <script type="text/javascript"><!-- function getProducts() { $('#product1 option').remove(); $.ajax({ url: 'index.php?route=sale/order/category&token=<?php echo $token; ?>&category_id=' + $('#category').attr('value'), dataType: 'json', success: function(data) { for (i = 0; i < data.length; i++) { $('#product1').append('<option value="' + data[i]['product_id'] + '">' + data[i]['name'] + ' (' + data[i]['model'] + ') </option>'); } } }); } getProducts(); //--></script> Но почему то кнопка "Добавить товар", на скрине указал, не срабатывает :( В чём может быть проблема ? Заранее спасипотому что !!
  6. Добрый вечер! Как сгделать, липотому что врогде как в сирых версиях есть нужна возможность добавления товара в заказе. Сейчас версия 1.5.5.1.2 и ик отображается: А нужно, чтобы вот ик, или что то похожее: Заранее спасипотому что !
  7. В "админке-настройки-поли" вклюлили уведомления ?
  8. 1. /catalog/controller/module/categoryhome.php <?php class ControllerModulecategoryhome extends Controller { protected $category_id = 0; protected $path = array(); protected function index($setting) { $this->language->load('module/categoryhome'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->load->model('catalog/category'); $this->load->model('tool/image'); $url = ''; $this->data['categoryhome'] = $this->getCategories($this->config->get('categoryhome_category')); $this->id = 'categoryhome'; if (isset($this->request->get['path'])) { $parts = explode('_', $this->request->get['path']); $this->category_id = end($this->path); } else { $parts = array(); } if (isset($parts[0])) { $this->data['category_id'] = $parts[0]; } else { $this->data['category_id'] = 0; } if (isset($parts[1])) { $this->data['child_id'] = $parts[1]; } else { $this->data['child_id'] = 0; } $this->load->model('catalog/product'); $this->data['categories'] = array(); $categories = $this->model_catalog_category->getCategories(0); //Показывать или нет когдачество товаров //$show_product_count = $this->config->get('config_product_count'); foreach ($categories as $category) { //Бугдем вылислять кол-во товаров в категориях только если это кол-во надо показывать //if ($show_product_count) { // $total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id'])); //} $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { //Бугдем вылислять кол-во товаров в категориях только если это кол-во надо показывать //if ($show_product_count) { // $data = array( // 'filter_category_id' => $child['category_id'], // 'filter_sub_category' => true // ); // // $product_total = $this->model_catalog_product->getTotalProducts($data); // // $total += $product_total; //} $children_data[] = array( 'category_id' => $child['category_id'], 'name' => $child['name'], 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } $this->data['categories'][] = array( 'category_id' => $category['category_id'], 'name' => $category['name'], 'children' => $children_data, 'href' => $this->url->link('product/category', 'path=' . $category['category_id']) ); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/categoryhome.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/categoryhome.tpl'; } else { $this->template = 'default/template/module/categoryhome.tpl'; } $this->render(); } protected function getCategories($parent_id, $current_path = '') { $categoryhome = array(); $category_id = array_shift($this->path); $results = $this->model_catalog_category->getCategories($parent_id); $i=0; foreach ($results as $result) { if (!$current_path) { $new_path = $result['category_id']; } else { $new_path = $current_path . '_' . $result['category_id']; } if ($this->category_id == $result['category_id']) { $categoryhome[$i]['href'] = $this->url->link('product/category', 'path=' . $new_path); } else { $categoryhome[$i]['href'] = $this->url->link('product/category', 'path=' . $new_path); } if ($result['image']) { $image = $result['image']; } else { $image = 'no_image.jpg'; } $categoryhome[$i]['thumb'] = $this->model_tool_image->resize($image, 150, 150); $categoryhome[$i]['name'] = $result['name']; $i++; } return $categoryhome; } } ?> 2. /catalog/view/theme/ваша_тема/template/module/categoryhome.tpl <div class="box"> <div class="box-content"> <div class="box-cat"> <?php foreach ($categoryhome as $cathome) { ?> <div> <div class="image"><a href="<?php echo $cathome['href']; ?>"><img src="<?php echo $cathome['thumb']; ?>" itle="<?php echo $cathome['name']; ?>" alt="<?php echo $cathome['name']; ?>" /></a> </div> <div class="name"><a href="<?php echo $cathome['href']; ?>"><?php echo $cathome['name']; ?></a></div> <?php foreach ($categories as $category) { if ($cathome['name'] == $category['name']) { ?> <?php if ($category['children']) { ?> <ul class="box-category"> <?php foreach ($category['children'] as $child) { ?> <li> <?php if ($child['category_id'] == $child_id) { ?> <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a> <?php } else { ?> <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a> <?php } ?> </li> <?php } ?> </ul> <?php } ?> <?php } ?> <?php } ?> </div> <?php } ?> </div> </div> </div>
  9. Доброй ноли. Проблема икова. на главной стоит модуль categoryhome Нужно было добавить подкатегории, но при их вывогде - выводяться все категории, а не для каждой родительской категории отгдельно. В чем может быть проблема ? Прикладываю контроллер и tpl модуля. Контроллер: <?php class ControllerModulecategoryhome extends Controller { protected $category_id = 0; protected $path = array(); protected function index($setting) { $this->language->load('module/categoryhome'); $this->data['heading_title'] = $this->language->get('heading_title'); $this->load->model('catalog/category'); $this->load->model('tool/image'); $url = ''; $this->data['categoryhome'] = $this->getCategories($this->config->get('categoryhome_category')); $this->id = 'categoryhome'; if (isset($this->request->get['path'])) { $parts = explode('_', $this->request->get['path']); $this->category_id = end($this->path); } else { $parts = array(); } if (isset($parts[0])) { $this->data['category_id'] = $parts[0]; } else { $this->data['category_id'] = 0; } if (isset($parts[1])) { $this->data['child_id'] = $parts[1]; } else { $this->data['child_id'] = 0; } $this->load->model('catalog/category'); $this->load->model('catalog/product'); $this->data['categories'] = array(); $categories = $this->model_catalog_category->getCategories(0); //Показывать или нет когдачество товаров //$show_product_count = $this->config->get('config_product_count'); foreach ($categories as $category) { //Бугдем вылислять кол-во товаров в категориях только если это кол-во надо показывать //if ($show_product_count) { // $total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $category['category_id'])); //} $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); foreach ($children as $child) { //Бугдем вылислять кол-во товаров в категориях только если это кол-во надо показывать //if ($show_product_count) { // $data = array( // 'filter_category_id' => $child['category_id'], // 'filter_sub_category' => true // ); // // $product_total = $this->model_catalog_product->getTotalProducts($data); // // $total += $product_total; //} $children_data[] = array( 'category_id' => $child['category_id'], 'name' => $child['name'], 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } $this->data['categories'][] = array( 'category_id' => $category['category_id'], 'name' => $category['name'], 'children' => $children_data, 'href' => $this->url->link('product/category', 'path=' . $category['category_id']) ); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/categoryhome.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/categoryhome.tpl'; } else { $this->template = 'default/template/module/categoryhome.tpl'; } $this->render(); } protected function getCategories($parent_id, $current_path = '') { $categoryhome = array(); $category_id = array_shift($this->path); $results = $this->model_catalog_category->getCategories($parent_id); $i=0; foreach ($results as $result) { if (!$current_path) { $new_path = $result['category_id']; } else { $new_path = $current_path . '_' . $result['category_id']; } if ($this->category_id == $result['category_id']) { $categoryhome[$i]['href'] = $this->url->link('product/category', 'path=' . $new_path); } else { $categoryhome[$i]['href'] = $this->url->link('product/category', 'path=' . $new_path); } if ($result['image']) { $image = $result['image']; } else { $image = 'no_image.jpg'; } $categoryhome[$i]['thumb'] = $this->model_tool_image->resize($image, 150, 150); $categoryhome[$i]['name'] = $result['name']; $i++; } return $categoryhome; } } ?> и tpl: <div class="box"> <div class="box-content"> <div class="box-cat"> <?php foreach ($categoryhome as $categoryhome) { ?> <div> <div class="image"><a href="<?php echo $categoryhome['href']; ?>"><img src="<?php echo $categoryhome['thumb']; ?>" title="<?php echo $categoryhome['name']; ?>" alt="<?php echo $categoryhome['name']; ?>" /></a></div> <div class="name"><a href="<?php echo $categoryhome['href']; ?>"><?php echo $categoryhome['name']; ?></a></div> <?php foreach ($categories as $category) { ?> <?php if ($category['children']) { ?> <?php foreach ($category['children'] as $child) { ?> <?php if ($child['category_id'] == $child_id) { ?> <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a> <?php } else { ?> <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a> <?php } ?> <?php } ?> <?php } ?> <?php } ?> </div> <?php } ?> </div> </div> </div>
  10. Сбросьте ссылку на сайт, скажу, что изменить надо бугдет.
  11. Как вариант: <input type="button" value="<?php echo $button_cart; ?>" id="button-cart" class="button" /> посивить после <div class="description">
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.