Einshtein Posted January 4, 2013 Share Posted January 4, 2013 Походу не в том разделе тему поднял, перенесите плз. Пытаюсь реализовать атрибуты на главной в рекомендуемых, по аналогии как краткое описание. Вывод краткого описания получается вывести Делаю так: featured.php вставляю 'description' => mb_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..', featured.tpl <div id="short-dis"><?php echo $product['description']; ?></div> и описание появляется под товаром в рекомендуемых Но вывод атрибутов по аналогичной схеме не получается. Вывести их в категорию вместо описания могу. Только не понимаю почему они не выводятся на главной. На всю страницу сыпятся ошибки attribute_groups in C:\wamp\www\Colozon\catalog\controller\module\featured.php on line 62 Мне это нужно для того чтобы в дальнейшем реализовать их через tooltip и впоследствии выложить в свободный доступ. Судя по гуглу, эта тема ещё не поднималась. Буду благодарен за любую помощь. Link to comment Share on other sites More sharing options...
Baco Posted January 4, 2013 Share Posted January 4, 2013 $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); Это функция из product.php . Она используется в выводе атрибутов в описание в списке товаров. Её же я и пытаюсь использовать в рекомендуемых. Но - увы 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Ps Удалось даже вывести модель товара. А вот с атрибутами хоть ты тресни Pss Сыпятся ошибки ссылающиеся на 65 строку в featured.php 'attribute_groups' => $this->model_catalog_product->getProductAttributes($this->request->get['product_id']), а на месте где должны выводится атрибуты - написано: Array Link to comment Share on other sites More sharing options... Baco Posted January 4, 2013 Share Posted January 4, 2013 Смотри, я вот так вот вывел в рекоммендуемых: $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); а в ТПЛ: <?php foreach ($products as $product) { ?> <div> <?php if ($product['thumb']) { ?> <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <?php if ($product['price']) { ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span> <?php } ?> </div> <?php } ?> <?php if ($product['rating']) { ?> <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div> <?php } ?> <?php if (!$catalog_mode) { ?> <div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div> <?php } ?> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></td> </tr> </thead> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?></td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> </div> <?php } ?> 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Благодарю Baco за помощь. Ошибки сыпаться перестали, но и атрибуты не выводятся. Я наверное безнадега. $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); <div class="flhomepage-box"> <?php foreach ($products as $product) { ?> <div> <?php if ($product['thumb']) { ?> <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></td> </tr> </thead> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?></td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php if ($product['price']) { ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span> <?php } ?> </div> <?php } ?> </div> В контроллере точно не нужно вызывать функцию через if ? Судя по всему я или не туда тыкаю ту строку, или ниче не понимаю. Хотя по логике вещей, функция стоит в массиве отвечающем непосредственно за элементы которые выводятся в товаре рекомендуемых Link to comment Share on other sites More sharing options... Baco Posted January 4, 2013 Share Posted January 4, 2013 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 очень странно почему не получается Рекомендуемые на главной: Список товаров в категории и рекомендуемые справа: Сейчас попробую на чистом движке 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 О крутяк! На чистой 1,5,3,1 все сработало сразу. Baco, ставлю огроменный плюс! Спасибо тебе, уже не раз выручаешь) Буду думать почему же на моем магазине не работает. Может это изза темы... 1 Link to comment Share on other sites More sharing options... Baco Posted January 4, 2013 Share Posted January 4, 2013 Да пожалуйста, тут по разному бывает, посмотри, мож. какой то вкмод влез в код и мешает... Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Только заметил такую странность: у всех товаров одинаковые атрибуты: Вы с таким не сталкивались? 1 Link to comment Share on other sites More sharing options... Vitukr Posted January 4, 2013 Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. тоже об этом подумал, уже разбераюсь спасибо 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 В общем вот что получилось: Но, к сожалению я зашел в тупик с одинаковыми атрибутами. Пока не разберусь - не могу дальше двигаться (отсортировать атрибуты, от групп и значений, придать оптимальные размеры бокса и т.д) Посему у меня просьба к знатокам - где капнуть чтобы понять почему ко всем товарам в рекомендуемых привязываются одинаковые атрибуты. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 Апну тему Уже неделю бьюсь головой ап стену Baco помог вывести атрибуты на главную и в любой версии по этому принципу они выводятся, за что ему ещё раз огромное спасибо. Но, к сожалению, они всем товарам присваиваются одинаковые. Судя по всему один индекс присваивается. Я не пойму почему так происходит. Ведь по аналогичному принципу они выводятся и в категориях и никаких проблем нет. Крутил вертел код - все без толку. Прошу помощи господа. Вопрос к Baco - у вас таких проблем небыло? Link to comment Share on other sites More sharing options... Baco Posted January 11, 2013 Share Posted January 11, 2013 Приветствую, увидел щас тему продолжение (ездил в карпаты на весь этот период)... щас попробую поекспериментировать - отпишусь. Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 С возвращением :) Спасибо! Пока осваиваю тему на примере выводом окошка в категориях, Бета версию запилил, сейчас попробую улучшить. Но хотелось бы все таки для модулей рекомендуемые и последние сделать Зы В Буковель на лыжи ездил?) Link to comment Share on other sites More sharing options... Baco Posted January 14, 2013 Share Posted January 14, 2013 Вот массив из контроллера: foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } //$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); } } а вот из tpl-ки: <?php if ($product['attribute_groups']) { ?> <table class="cat-attributes"> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?>:</td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php } ?> З.Ы. Не, не в Буковель, в Межгорье... 2 Link to comment Share on other sites More sharing options... 1 year later... OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options... 2 weeks later... sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options... 2 weeks later... Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options... 2 weeks later... Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options... Prev 1 2 Next Page 1 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Similar Content [Поддержка] Объединение групп атрибутов, атрибутов и их значений 1 2 By Stealth421, October 17, 2017 атрибуты группы атрибутов (and 1 more) Tagged with: атрибуты группы атрибутов обьединение 33 replies 8,717 views Dokamir December 4 [Решено] В карточке товара - не нужно название группы атрибутов By akulukin, December 20, 2017 группа атрибутов убрать название группы атрибутов (and 1 more) Tagged with: группа атрибутов убрать название группы атрибутов строчку группы атрибутов - долой! 10 replies 2,498 views Danishevskiy November 23 мы рекомендуем Рекомендуемые товары By OCdevWizard, April 12, 2018 ocdevwizard upsell (and 24 more) Tagged with: ocdevwizard upsell маркетинг рекомендации конверсия с этим товаром покупают аксессуары рекомендуемые доп товары рекомендуемые товары похожие товары seo seo страницы посадочные страницы seo page extra featured featured товары из категории хиты продаж новинки новинки из категории хиты из категории вместе покупают хиты cross sell сопутстввующие товары 0 comments 11,294 views OCdevWizard April 12, 2018 Рекомендуемые товары с мультиязычным заголовком и кнопкой By radaevich, December 4 featured featured title (and 3 more) Tagged with: featured featured title featured button рекомендуемые с заголовком рекомендуемые товары 0 comments 120 views radaevich November 21 Авто-подбор рекомендуемых товаров By kJlukOo, July 31, 2016 рекомендуемые авто рекомендуемые (and 1 more) Tagged with: рекомендуемые авто рекомендуемые подбор рекомендуемых 1 comment 18,145 views kJlukOo May 10, 2017 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Підтримка та відповіді на запитання. Допомога програмістам та розробникам [Решено] Атрибуты на главной в рекомендуемых Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення Extract from the account of individual entrepreneurs in PrivatBank for Opencart By bogdan281989 Featured Products with Multilingual Title and Button By radaevich Unused Images Actions By Symplax Модуль "WB Калькулятор и Фильтр доставки" By whiteblue Пользовательские Шаблоны By RoS × Existing user? Sign In Sign Up Shopping section Back Purchased extensions Invoices Whishlist Alternative Contacts Forums News ocStore Back Official site Demo ocStore 3.0.3.2 Demo ocStore 2.3.0.2.4 Download ocStore Docs Release History Blogs Extensions Templates Back Free templates Paid templates Where to buy modules? Services FAQ OpenCart.Pro Back Demo Buy Compare × 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. I accept
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($this->request->get['product_id']); Это функция из product.php . Она используется в выводе атрибутов в описание в списке товаров. Её же я и пытаюсь использовать в рекомендуемых. Но - увы 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Ps Удалось даже вывести модель товара. А вот с атрибутами хоть ты тресни Pss Сыпятся ошибки ссылающиеся на 65 строку в featured.php 'attribute_groups' => $this->model_catalog_product->getProductAttributes($this->request->get['product_id']), а на месте где должны выводится атрибуты - написано: Array Link to comment Share on other sites More sharing options...
Baco Posted January 4, 2013 Share Posted January 4, 2013 Смотри, я вот так вот вывел в рекоммендуемых: $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); а в ТПЛ: <?php foreach ($products as $product) { ?> <div> <?php if ($product['thumb']) { ?> <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <?php if ($product['price']) { ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span> <?php } ?> </div> <?php } ?> <?php if ($product['rating']) { ?> <div class="rating"><img src="catalog/view/theme/default/image/stars-<?php echo $product['rating']; ?>.png" alt="<?php echo $product['reviews']; ?>" /></div> <?php } ?> <?php if (!$catalog_mode) { ?> <div class="cart"><input type="button" value="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button" /></div> <?php } ?> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></td> </tr> </thead> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?></td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> </div> <?php } ?> 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Благодарю Baco за помощь. Ошибки сыпаться перестали, но и атрибуты не выводятся. Я наверное безнадега. $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); <div class="flhomepage-box"> <?php foreach ($products as $product) { ?> <div> <?php if ($product['thumb']) { ?> <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></td> </tr> </thead> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?></td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php if ($product['price']) { ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span> <?php } ?> </div> <?php } ?> </div> В контроллере точно не нужно вызывать функцию через if ? Судя по всему я или не туда тыкаю ту строку, или ниче не понимаю. Хотя по логике вещей, функция стоит в массиве отвечающем непосредственно за элементы которые выводятся в товаре рекомендуемых Link to comment Share on other sites More sharing options... Baco Posted January 4, 2013 Share Posted January 4, 2013 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 очень странно почему не получается Рекомендуемые на главной: Список товаров в категории и рекомендуемые справа: Сейчас попробую на чистом движке 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 О крутяк! На чистой 1,5,3,1 все сработало сразу. Baco, ставлю огроменный плюс! Спасибо тебе, уже не раз выручаешь) Буду думать почему же на моем магазине не работает. Может это изза темы... 1 Link to comment Share on other sites More sharing options... Baco Posted January 4, 2013 Share Posted January 4, 2013 Да пожалуйста, тут по разному бывает, посмотри, мож. какой то вкмод влез в код и мешает... Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Только заметил такую странность: у всех товаров одинаковые атрибуты: Вы с таким не сталкивались? 1 Link to comment Share on other sites More sharing options... Vitukr Posted January 4, 2013 Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. тоже об этом подумал, уже разбераюсь спасибо 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 В общем вот что получилось: Но, к сожалению я зашел в тупик с одинаковыми атрибутами. Пока не разберусь - не могу дальше двигаться (отсортировать атрибуты, от групп и значений, придать оптимальные размеры бокса и т.д) Посему у меня просьба к знатокам - где капнуть чтобы понять почему ко всем товарам в рекомендуемых привязываются одинаковые атрибуты. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 Апну тему Уже неделю бьюсь головой ап стену Baco помог вывести атрибуты на главную и в любой версии по этому принципу они выводятся, за что ему ещё раз огромное спасибо. Но, к сожалению, они всем товарам присваиваются одинаковые. Судя по всему один индекс присваивается. Я не пойму почему так происходит. Ведь по аналогичному принципу они выводятся и в категориях и никаких проблем нет. Крутил вертел код - все без толку. Прошу помощи господа. Вопрос к Baco - у вас таких проблем небыло? Link to comment Share on other sites More sharing options... Baco Posted January 11, 2013 Share Posted January 11, 2013 Приветствую, увидел щас тему продолжение (ездил в карпаты на весь этот период)... щас попробую поекспериментировать - отпишусь. Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 С возвращением :) Спасибо! Пока осваиваю тему на примере выводом окошка в категориях, Бета версию запилил, сейчас попробую улучшить. Но хотелось бы все таки для модулей рекомендуемые и последние сделать Зы В Буковель на лыжи ездил?) Link to comment Share on other sites More sharing options... Baco Posted January 14, 2013 Share Posted January 14, 2013 Вот массив из контроллера: foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } //$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); } } а вот из tpl-ки: <?php if ($product['attribute_groups']) { ?> <table class="cat-attributes"> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?>:</td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php } ?> З.Ы. Не, не в Буковель, в Межгорье... 2 Link to comment Share on other sites More sharing options... 1 year later... OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options... 2 weeks later... sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options... 2 weeks later... Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options... 2 weeks later... Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options... Prev 1 2 Next Page 1 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Similar Content [Поддержка] Объединение групп атрибутов, атрибутов и их значений 1 2 By Stealth421, October 17, 2017 атрибуты группы атрибутов (and 1 more) Tagged with: атрибуты группы атрибутов обьединение 33 replies 8,717 views Dokamir December 4 [Решено] В карточке товара - не нужно название группы атрибутов By akulukin, December 20, 2017 группа атрибутов убрать название группы атрибутов (and 1 more) Tagged with: группа атрибутов убрать название группы атрибутов строчку группы атрибутов - долой! 10 replies 2,498 views Danishevskiy November 23 мы рекомендуем Рекомендуемые товары By OCdevWizard, April 12, 2018 ocdevwizard upsell (and 24 more) Tagged with: ocdevwizard upsell маркетинг рекомендации конверсия с этим товаром покупают аксессуары рекомендуемые доп товары рекомендуемые товары похожие товары seo seo страницы посадочные страницы seo page extra featured featured товары из категории хиты продаж новинки новинки из категории хиты из категории вместе покупают хиты cross sell сопутстввующие товары 0 comments 11,294 views OCdevWizard April 12, 2018 Рекомендуемые товары с мультиязычным заголовком и кнопкой By radaevich, December 4 featured featured title (and 3 more) Tagged with: featured featured title featured button рекомендуемые с заголовком рекомендуемые товары 0 comments 120 views radaevich November 21 Авто-подбор рекомендуемых товаров By kJlukOo, July 31, 2016 рекомендуемые авто рекомендуемые (and 1 more) Tagged with: рекомендуемые авто рекомендуемые подбор рекомендуемых 1 comment 18,145 views kJlukOo May 10, 2017 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Підтримка та відповіді на запитання. Допомога програмістам та розробникам [Решено] Атрибуты на главной в рекомендуемых Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення Extract from the account of individual entrepreneurs in PrivatBank for Opencart By bogdan281989 Featured Products with Multilingual Title and Button By radaevich Unused Images Actions By Symplax Модуль "WB Калькулятор и Фильтр доставки" By whiteblue Пользовательские Шаблоны By RoS × Existing user? Sign In Sign Up Shopping section Back Purchased extensions Invoices Whishlist Alternative Contacts Forums News ocStore Back Official site Demo ocStore 3.0.3.2 Demo ocStore 2.3.0.2.4 Download ocStore Docs Release History Blogs Extensions Templates Back Free templates Paid templates Where to buy modules? Services FAQ OpenCart.Pro Back Demo Buy Compare × 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. I accept
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Благодарю Baco за помощь. Ошибки сыпаться перестали, но и атрибуты не выводятся. Я наверное безнадега. $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); <div class="flhomepage-box"> <?php foreach ($products as $product) { ?> <div> <?php if ($product['thumb']) { ?> <div class="image"><a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" /></a></div> <?php } ?> <div class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></div> <table class="attribute"> <?php foreach ($attribute_groups as $attribute_group) { ?> <thead> <tr> <td colspan="2"><?php echo $attribute_group['name']; ?></td> </tr> </thead> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?></td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php if ($product['price']) { ?> <div class="price"> <?php if (!$product['special']) { ?> <?php echo $product['price']; ?> <?php } else { ?> <span class="price-old"><?php echo $product['price']; ?></span> <span class="price-new"><?php echo $product['special']; ?></span> <?php } ?> </div> <?php } ?> </div> В контроллере точно не нужно вызывать функцию через if ? Судя по всему я или не туда тыкаю ту строку, или ниче не понимаю. Хотя по логике вещей, функция стоит в массиве отвечающем непосредственно за элементы которые выводятся в товаре рекомендуемых Link to comment Share on other sites More sharing options...
Baco Posted January 4, 2013 Share Posted January 4, 2013 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 очень странно почему не получается Рекомендуемые на главной: Список товаров в категории и рекомендуемые справа: Сейчас попробую на чистом движке 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 О крутяк! На чистой 1,5,3,1 все сработало сразу. Baco, ставлю огроменный плюс! Спасибо тебе, уже не раз выручаешь) Буду думать почему же на моем магазине не работает. Может это изза темы... 1 Link to comment Share on other sites More sharing options... Baco Posted January 4, 2013 Share Posted January 4, 2013 Да пожалуйста, тут по разному бывает, посмотри, мож. какой то вкмод влез в код и мешает... Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Только заметил такую странность: у всех товаров одинаковые атрибуты: Вы с таким не сталкивались? 1 Link to comment Share on other sites More sharing options... Vitukr Posted January 4, 2013 Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. тоже об этом подумал, уже разбераюсь спасибо 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 В общем вот что получилось: Но, к сожалению я зашел в тупик с одинаковыми атрибутами. Пока не разберусь - не могу дальше двигаться (отсортировать атрибуты, от групп и значений, придать оптимальные размеры бокса и т.д) Посему у меня просьба к знатокам - где капнуть чтобы понять почему ко всем товарам в рекомендуемых привязываются одинаковые атрибуты. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 Апну тему Уже неделю бьюсь головой ап стену Baco помог вывести атрибуты на главную и в любой версии по этому принципу они выводятся, за что ему ещё раз огромное спасибо. Но, к сожалению, они всем товарам присваиваются одинаковые. Судя по всему один индекс присваивается. Я не пойму почему так происходит. Ведь по аналогичному принципу они выводятся и в категориях и никаких проблем нет. Крутил вертел код - все без толку. Прошу помощи господа. Вопрос к Baco - у вас таких проблем небыло? Link to comment Share on other sites More sharing options... Baco Posted January 11, 2013 Share Posted January 11, 2013 Приветствую, увидел щас тему продолжение (ездил в карпаты на весь этот период)... щас попробую поекспериментировать - отпишусь. Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 С возвращением :) Спасибо! Пока осваиваю тему на примере выводом окошка в категориях, Бета версию запилил, сейчас попробую улучшить. Но хотелось бы все таки для модулей рекомендуемые и последние сделать Зы В Буковель на лыжи ездил?) Link to comment Share on other sites More sharing options... Baco Posted January 14, 2013 Share Posted January 14, 2013 Вот массив из контроллера: foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } //$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); } } а вот из tpl-ки: <?php if ($product['attribute_groups']) { ?> <table class="cat-attributes"> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?>:</td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php } ?> З.Ы. Не, не в Буковель, в Межгорье... 2 Link to comment Share on other sites More sharing options... 1 year later... OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options... 2 weeks later... sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options... 2 weeks later... Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options... 2 weeks later... Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options... Prev 1 2 Next Page 1 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Similar Content [Поддержка] Объединение групп атрибутов, атрибутов и их значений 1 2 By Stealth421, October 17, 2017 атрибуты группы атрибутов (and 1 more) Tagged with: атрибуты группы атрибутов обьединение 33 replies 8,717 views Dokamir December 4 [Решено] В карточке товара - не нужно название группы атрибутов By akulukin, December 20, 2017 группа атрибутов убрать название группы атрибутов (and 1 more) Tagged with: группа атрибутов убрать название группы атрибутов строчку группы атрибутов - долой! 10 replies 2,498 views Danishevskiy November 23 мы рекомендуем Рекомендуемые товары By OCdevWizard, April 12, 2018 ocdevwizard upsell (and 24 more) Tagged with: ocdevwizard upsell маркетинг рекомендации конверсия с этим товаром покупают аксессуары рекомендуемые доп товары рекомендуемые товары похожие товары seo seo страницы посадочные страницы seo page extra featured featured товары из категории хиты продаж новинки новинки из категории хиты из категории вместе покупают хиты cross sell сопутстввующие товары 0 comments 11,294 views OCdevWizard April 12, 2018 Рекомендуемые товары с мультиязычным заголовком и кнопкой By radaevich, December 4 featured featured title (and 3 more) Tagged with: featured featured title featured button рекомендуемые с заголовком рекомендуемые товары 0 comments 120 views radaevich November 21 Авто-подбор рекомендуемых товаров By kJlukOo, July 31, 2016 рекомендуемые авто рекомендуемые (and 1 more) Tagged with: рекомендуемые авто рекомендуемые подбор рекомендуемых 1 comment 18,145 views kJlukOo May 10, 2017 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Підтримка та відповіді на запитання. Допомога програмістам та розробникам [Решено] Атрибуты на главной в рекомендуемых Покупцям Оплата розширень фізичними особами Оплата розширень юридичними особами Політика повернень Розробникам Регламент розміщення розширень Регламент продажу та підтримки розширень Віртуальний обліковий запис автора Політика просування оголошень API каталогу розширень Вирішення спорів щодо авторських прав Корисна інформація Публічна оферта Політика повернень Політика конфіденційності Платіжна політика Політика передачі особистих даних Політика прозорості Останні розширення Extract from the account of individual entrepreneurs in PrivatBank for Opencart By bogdan281989 Featured Products with Multilingual Title and Button By radaevich Unused Images Actions By Symplax Модуль "WB Калькулятор и Фильтр доставки" By whiteblue Пользовательские Шаблоны By RoS
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 очень странно почему не получается Рекомендуемые на главной: Список товаров в категории и рекомендуемые справа: Сейчас попробую на чистом движке 1 Link to comment Share on other sites More sharing options...
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 О крутяк! На чистой 1,5,3,1 все сработало сразу. Baco, ставлю огроменный плюс! Спасибо тебе, уже не раз выручаешь) Буду думать почему же на моем магазине не работает. Может это изза темы... 1 Link to comment Share on other sites More sharing options...
Baco Posted January 4, 2013 Share Posted January 4, 2013 Да пожалуйста, тут по разному бывает, посмотри, мож. какой то вкмод влез в код и мешает... Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Только заметил такую странность: у всех товаров одинаковые атрибуты: Вы с таким не сталкивались? 1 Link to comment Share on other sites More sharing options... Vitukr Posted January 4, 2013 Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. тоже об этом подумал, уже разбераюсь спасибо 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 В общем вот что получилось: Но, к сожалению я зашел в тупик с одинаковыми атрибутами. Пока не разберусь - не могу дальше двигаться (отсортировать атрибуты, от групп и значений, придать оптимальные размеры бокса и т.д) Посему у меня просьба к знатокам - где капнуть чтобы понять почему ко всем товарам в рекомендуемых привязываются одинаковые атрибуты. 1 Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 Апну тему Уже неделю бьюсь головой ап стену Baco помог вывести атрибуты на главную и в любой версии по этому принципу они выводятся, за что ему ещё раз огромное спасибо. Но, к сожалению, они всем товарам присваиваются одинаковые. Судя по всему один индекс присваивается. Я не пойму почему так происходит. Ведь по аналогичному принципу они выводятся и в категориях и никаких проблем нет. Крутил вертел код - все без толку. Прошу помощи господа. Вопрос к Baco - у вас таких проблем небыло? Link to comment Share on other sites More sharing options... Baco Posted January 11, 2013 Share Posted January 11, 2013 Приветствую, увидел щас тему продолжение (ездил в карпаты на весь этот период)... щас попробую поекспериментировать - отпишусь. Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 С возвращением :) Спасибо! Пока осваиваю тему на примере выводом окошка в категориях, Бета версию запилил, сейчас попробую улучшить. Но хотелось бы все таки для модулей рекомендуемые и последние сделать Зы В Буковель на лыжи ездил?) Link to comment Share on other sites More sharing options... Baco Posted January 14, 2013 Share Posted January 14, 2013 Вот массив из контроллера: foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } //$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); } } а вот из tpl-ки: <?php if ($product['attribute_groups']) { ?> <table class="cat-attributes"> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?>:</td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php } ?> З.Ы. Не, не в Буковель, в Межгорье... 2 Link to comment Share on other sites More sharing options... 1 year later... OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options... 2 weeks later... sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options... 2 weeks later... Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options... 2 weeks later... Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options... Prev 1 2 Next Page 1 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Similar Content [Поддержка] Объединение групп атрибутов, атрибутов и их значений 1 2 By Stealth421, October 17, 2017 атрибуты группы атрибутов (and 1 more) Tagged with: атрибуты группы атрибутов обьединение 33 replies 8,717 views Dokamir December 4 [Решено] В карточке товара - не нужно название группы атрибутов By akulukin, December 20, 2017 группа атрибутов убрать название группы атрибутов (and 1 more) Tagged with: группа атрибутов убрать название группы атрибутов строчку группы атрибутов - долой! 10 replies 2,498 views Danishevskiy November 23 мы рекомендуем Рекомендуемые товары By OCdevWizard, April 12, 2018 ocdevwizard upsell (and 24 more) Tagged with: ocdevwizard upsell маркетинг рекомендации конверсия с этим товаром покупают аксессуары рекомендуемые доп товары рекомендуемые товары похожие товары seo seo страницы посадочные страницы seo page extra featured featured товары из категории хиты продаж новинки новинки из категории хиты из категории вместе покупают хиты cross sell сопутстввующие товары 0 comments 11,294 views OCdevWizard April 12, 2018 Рекомендуемые товары с мультиязычным заголовком и кнопкой By radaevich, December 4 featured featured title (and 3 more) Tagged with: featured featured title featured button рекомендуемые с заголовком рекомендуемые товары 0 comments 120 views radaevich November 21 Авто-подбор рекомендуемых товаров By kJlukOo, July 31, 2016 рекомендуемые авто рекомендуемые (and 1 more) Tagged with: рекомендуемые авто рекомендуемые подбор рекомендуемых 1 comment 18,145 views kJlukOo May 10, 2017 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Підтримка та відповіді на запитання. Допомога програмістам та розробникам [Решено] Атрибуты на главной в рекомендуемых
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Только заметил такую странность: у всех товаров одинаковые атрибуты: Вы с таким не сталкивались? 1 Link to comment Share on other sites More sharing options...
Vitukr Posted January 4, 2013 Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. 1 Link to comment Share on other sites More sharing options...
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 Наверное атрибуты выводятся без индекса или инициализируется нулевым индексом. Т.е. выводится первый атрибут в списке array. тоже об этом подумал, уже разбераюсь спасибо 1 Link to comment Share on other sites More sharing options...
Einshtein Posted January 4, 2013 Author Share Posted January 4, 2013 В общем вот что получилось: Но, к сожалению я зашел в тупик с одинаковыми атрибутами. Пока не разберусь - не могу дальше двигаться (отсортировать атрибуты, от групп и значений, придать оптимальные размеры бокса и т.д) Посему у меня просьба к знатокам - где капнуть чтобы понять почему ко всем товарам в рекомендуемых привязываются одинаковые атрибуты. 1 Link to comment Share on other sites More sharing options...
Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 Апну тему Уже неделю бьюсь головой ап стену Baco помог вывести атрибуты на главную и в любой версии по этому принципу они выводятся, за что ему ещё раз огромное спасибо. Но, к сожалению, они всем товарам присваиваются одинаковые. Судя по всему один индекс присваивается. Я не пойму почему так происходит. Ведь по аналогичному принципу они выводятся и в категориях и никаких проблем нет. Крутил вертел код - все без толку. Прошу помощи господа. Вопрос к Baco - у вас таких проблем небыло? Link to comment Share on other sites More sharing options...
Baco Posted January 11, 2013 Share Posted January 11, 2013 Приветствую, увидел щас тему продолжение (ездил в карпаты на весь этот период)... щас попробую поекспериментировать - отпишусь. Link to comment Share on other sites More sharing options... Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 С возвращением :) Спасибо! Пока осваиваю тему на примере выводом окошка в категориях, Бета версию запилил, сейчас попробую улучшить. Но хотелось бы все таки для модулей рекомендуемые и последние сделать Зы В Буковель на лыжи ездил?) Link to comment Share on other sites More sharing options... Baco Posted January 14, 2013 Share Posted January 14, 2013 Вот массив из контроллера: foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } //$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); } } а вот из tpl-ки: <?php if ($product['attribute_groups']) { ?> <table class="cat-attributes"> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?>:</td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php } ?> З.Ы. Не, не в Буковель, в Межгорье... 2 Link to comment Share on other sites More sharing options... 1 year later... OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options... 2 weeks later... sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options... 2 weeks later... Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options... 2 weeks later... Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options... Prev 1 2 Next Page 1 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0 Go to topic listing Similar Content [Поддержка] Объединение групп атрибутов, атрибутов и их значений 1 2 By Stealth421, October 17, 2017 атрибуты группы атрибутов (and 1 more) Tagged with: атрибуты группы атрибутов обьединение 33 replies 8,717 views Dokamir December 4 [Решено] В карточке товара - не нужно название группы атрибутов By akulukin, December 20, 2017 группа атрибутов убрать название группы атрибутов (and 1 more) Tagged with: группа атрибутов убрать название группы атрибутов строчку группы атрибутов - долой! 10 replies 2,498 views Danishevskiy November 23 мы рекомендуем Рекомендуемые товары By OCdevWizard, April 12, 2018 ocdevwizard upsell (and 24 more) Tagged with: ocdevwizard upsell маркетинг рекомендации конверсия с этим товаром покупают аксессуары рекомендуемые доп товары рекомендуемые товары похожие товары seo seo страницы посадочные страницы seo page extra featured featured товары из категории хиты продаж новинки новинки из категории хиты из категории вместе покупают хиты cross sell сопутстввующие товары 0 comments 11,294 views OCdevWizard April 12, 2018 Рекомендуемые товары с мультиязычным заголовком и кнопкой By radaevich, December 4 featured featured title (and 3 more) Tagged with: featured featured title featured button рекомендуемые с заголовком рекомендуемые товары 0 comments 120 views radaevich November 21 Авто-подбор рекомендуемых товаров By kJlukOo, July 31, 2016 рекомендуемые авто рекомендуемые (and 1 more) Tagged with: рекомендуемые авто рекомендуемые подбор рекомендуемых 1 comment 18,145 views kJlukOo May 10, 2017 Recently Browsing 0 members No registered users viewing this page.
Einshtein Posted January 11, 2013 Author Share Posted January 11, 2013 С возвращением :) Спасибо! Пока осваиваю тему на примере выводом окошка в категориях, Бета версию запилил, сейчас попробую улучшить. Но хотелось бы все таки для модулей рекомендуемые и последние сделать Зы В Буковель на лыжи ездил?) Link to comment Share on other sites More sharing options...
Baco Posted January 14, 2013 Share Posted January 14, 2013 Вот массив из контроллера: foreach ($products as $product_id) { $product_info = $this->model_catalog_product->getProduct($product_id); if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } //$this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_review_status')) { $rating = $product_info['rating']; } else { $rating = false; } $this->data['products'][] = array( 'product_id' => $product_info['product_id'], 'thumb' => $image, 'name' => $product_info['name'], 'price' => $price, 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'special' => $special, 'rating' => $rating, 'reviews' => sprintf($this->language->get('text_reviews'), (int)$product_info['reviews']), 'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']), ); } } а вот из tpl-ки: <?php if ($product['attribute_groups']) { ?> <table class="cat-attributes"> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <tbody> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <tr> <td><?php echo $attribute['name']; ?>:</td> <td><?php echo $attribute['text']; ?></td> </tr> <?php } ?> </tbody> <?php } ?> </table> <?php } ?> З.Ы. Не, не в Буковель, в Межгорье... 2 Link to comment Share on other sites More sharing options... 1 year later... OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options... 2 weeks later... sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options... 2 weeks later... Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options... Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options... Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options... 2 weeks later... Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options... Prev 1 2 Next Page 1 of 2 Create an account or sign in to comment You need to be a member in order to leave a comment Create an account Sign up for a new account in our community. It's easy! Register a new account Sign in Already have an account? Sign in here. Sign In Now Share More sharing options... Followers 0
OlegVladislavovich Posted December 16, 2014 Share Posted December 16, 2014 Вот массив из контроллера: <>а вот из tpl-ки:<> От души, помогло) Вывелись атрибуты в Рекомендуемые, наконец-то) Link to comment Share on other sites More sharing options...
sobak Posted December 25, 2014 Share Posted December 25, 2014 А подскажите как можно взять конкретный атрибут. Ну у меня в атрибутах указано "Площадь в м2" = 1.6 Я хочу чтобы у меня цена считалась используя данный параметр, но как мне его выковырять для страницы ПРОДУКТА. Link to comment Share on other sites More sharing options...
Olegich Posted January 4, 2015 Share Posted January 4, 2015 Верь в себя и в свою цель... В контроллере я вставил примерно сюда: if ($product_info) { if ($product_info['image']) { $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($product_info['product_id']); if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$product_info['special']) { $special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } Спасибо. Все сделал и работает с модулем "Рекомендуемые". Попробовал тоже самое сделать с модулями "Последние" и "Хиты продаж". Увы фокус не получился. Ошибка :( У меня на главной выводятся три эти модуля, разметка у них должна быть одинаковая. Link to comment Share on other sites More sharing options...
Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Link to comment Share on other sites More sharing options...
Olegich Posted January 5, 2015 Share Posted January 5, 2015 для хитов и прочих модулей кроме рекомендуемых нужно писать не product_info а result $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); Что то ему не нравится. Ошибка Notice: Undefined index: attribute_groups in... ...template\module\bestseller.tpl on line 20 bestseller.tpl <div class="attributeModule"> <?php if ($product['attribute_groups']) { ?> <?php foreach ($product['attribute_groups'] as $attribute_group) { ?> <?php foreach ($attribute_group['attribute'] as $attribute) { ?> <?php echo $attribute['text']; ?> <?php } ?> <?php } ?> <?php } ?> </div> bestseller.php foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']); } else { $image = false; } $this->data['attribute_groups'] = $this->model_catalog_product->getProductAttributes($result['product_id']); 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 = $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']), ); } Link to comment Share on other sites More sharing options...
Einshtein Posted January 5, 2015 Author Share Posted January 5, 2015 в массив $this->data['products'][] = array( прописать 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), Link to comment Share on other sites More sharing options...
Olegich Posted January 5, 2015 Share Posted January 5, 2015 (edited) Спасибо, все заработало. Edited January 5, 2015 by afwollis overquote deleted Link to comment Share on other sites More sharing options...
Guest Posted January 14, 2015 Share Posted January 14, 2015 А есть функция вывисти к примеру необходисое количество - не 20 -30 а везде по 8 атрбутов Link to comment Share on other sites More sharing options...
Recommended Posts