Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

fanatic

Users
  • Posts

    4,905
  • Joined

  • Last visited

Everything posted by fanatic

  1. из за одной ссылки добавлять поле в базу? не по фен шую лучше уж добавить ручками, после вывода категорий. или счетчик в цикле и выводим на какой позиции нужно(имхо)
  2. согласен, но не задом на перед что объяснить? что такое циклы в php и как с помощью их выводится html меню?
  3. да, не то. в браузере уже сформированный html. а в файле, php формирует список. эти надписи, добавил кто-то, вроде вас. наверно
  4. да, не доглядел, что разговор о 1.5 принял 156 за строку, так как перед этим было и потом
  5. $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $data['categories'][] = array( 'id' => $result['category_id'],// а так? 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url) ); }
  6. могу перенести. в чем сотрудничество?
  7. слетит. чтобы не слетело нужно через модификатор
  8. admin/controller/catelog/attribute.php метод autocomplete() $filter_data = array( 'filter_name' => $this->request->get['filter_name'], 'start' => 0, 'limit' => 5//это );
  9. контоллер catalog/conroller/product/categry.php $results = $this->model_catalog_category->getCategories($category_id); foreach ($results as $result) { $filter_data = array( 'filter_category_id' => $result['category_id'], 'filter_sub_category' => true ); $data['categories'][] = array( 'name' => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url), // добавить 'img' => $this->model_tool_image->resize($category_info['image'], $this->config->get($this->config->get('config_theme') . '_image_category_width'), $this->config->get($this->config->get('config_theme') . '_image_category_height')) ); } вместо $this->config->get($this->config->get('config_theme') . '_image_category_width'), $this->config->get($this->config->get('config_theme') . '_image_category_height') можно прописать свои размеры. будет выклядеть так 'img' => $this->model_tool_image->resize($category_info['image'], 20.20) в шаблоне catalog/view/theme/ваша тема/template/product/category.tpl <?php if ($categories) { ?> <h3><?php echo $text_refine; ?></h3> <?php if (count($categories) <= 5) { ?> <div class="row"> <div class="col-sm-3"> <ul> <?php foreach ($categories as $category) { ?> <!--добалили вывод изображения--> <li><img src="<?php echo $category['img']; ?>"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li> <?php } ?> </ul> </div> </div> <?php } else { ?> <div class="row"> <?php foreach (array_chunk($categories, ceil(count($categories) / 4)) as $categories) { ?> <div class="col-sm-3"> <ul> <?php foreach ($categories as $category) { ?> <!--добалили вывод изображения--> <li><img src="<?php echo $category['img']; ?>"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li> <?php } ?> </ul> </div> <?php } ?> </div> <?php } ?> <?php } ?> код в шаблоне у вас может быть немного другой. на суть думаю понятна
  10. я не могу глянуть скрин, украина не дружит с яндексом. почему не выложить тут это?
  11. у вас, если у товара нет главного изображения, подставляется дефолтное(стандартный функционал движка) if ($result['image']) { $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')); } else { $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')); } а дальше идет проверка. если есть доп. изображения, берется первое, если нет в доп. изображение добавляется главное. замените $images = $this->model_catalog_product->getProductImages($result['product_id']); if(isset($images[0]['image']) && !empty($images)){ $images = $images[0]['image']; }else { $images = $image; } на $images = $this->model_catalog_product->getProductImages($result['product_id']); if (isset($images[0]['image']) && !empty($images)) { $images = $this->model_tool_image->resize($images[0]['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height')); } else { $images = false; } и дальше найдите $data['products'][] = array( 'product_id' => $result['product_id'], 'thumb' => $image, 'thumb_swap' => $this->model_tool_image->resize($images, $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height')), 'name' => $result['name'], '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')) . '..', 'price' => $price, 'special' => $special, 'percentsaving' => round((($result['price'] - $result['special'])/$result['price'])*100, 0), 'tax' => $tax, 'minimum' => $result['minimum'] > 0 ? $result['minimum'] : 1, 'rating' => $result['rating'], 'quick' => $this->url->link('product/quick_view','&product_id=' . $result['product_id']), 'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url) ); 'thumb_swap' => $this->model_tool_image->resize($images, $this->config->get($this->config->get('config_theme') . замените на 'thumb_swap' => $images,
  12. значит, изменения в контроллер, вносились напрямую файл catalog/controller/product/category.php
  13. а контроллер, не хотите показать? хозяин барин
  14. ну если не нужен функционал с двойным изображением, то пойдет, хоть и костыль
  15. а из контноллера передали эту переменную? а вообще нафига плодить сообщения https://opencartforum.com/topic/86991-vyvod-izobrazheniya-kategorii/?tab=comments#comment-1007273
×
×
  • 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.