helen2014 Posted September 18, 2019 Share Posted September 18, 2019 Здравствуйте! ocStore 3.0.2.0 Помогите вывести атрибуты по id. {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options...
Blast Posted September 18, 2019 Share Posted September 18, 2019 16 минут назад, helen2014 сказал: Здравствуйте! ocStore 3.0.2.0 Помогите вывести атрибуты по id. вывод названия и значения только атрибуи с id=3 {% if attribute.attribute_id == 3 %} <tr> <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> </tr> {% endif %} 2 Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 Типа икого что-то? {% if attribute.id == '1' or attribute.id == '2' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 Спасипотому что! Но этот вариант не рилииет. Выводится только группа атрибуи. Сам атрибут и значения атрибуи нет. Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 да, и у меня не правильно им, сорри - не attribute.id, а attribute.attribute_id, как писал @Blast Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 2 минуты назад, PaulKravchenko сказал: @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id == '13' or attribute.id == '13' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 (edited) {% if attribute.attribute_id == '13' %} если нужно несколько атрибутов, то можно ик: {% if attribute.attribute_id in [13, 14, 15] %} Edited September 18, 2019 by Blast 1 Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 1 минуту назад, Blast сказал: {% if attribute.attribute_id == '13' %} Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 1 минуту назад, helen2014 сказал: добавляем через запятую? не прокатит, через or Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0 Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums 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 Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × 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
PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 Типа икого что-то? {% if attribute.id == '1' or attribute.id == '2' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 Спасипотому что! Но этот вариант не рилииет. Выводится только группа атрибуи. Сам атрибут и значения атрибуи нет. Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 да, и у меня не правильно им, сорри - не attribute.id, а attribute.attribute_id, как писал @Blast Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 2 минуты назад, PaulKravchenko сказал: @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id == '13' or attribute.id == '13' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 (edited) {% if attribute.attribute_id == '13' %} если нужно несколько атрибутов, то можно ик: {% if attribute.attribute_id in [13, 14, 15] %} Edited September 18, 2019 by Blast 1 Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 1 минуту назад, Blast сказал: {% if attribute.attribute_id == '13' %} Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 1 минуту назад, helen2014 сказал: добавляем через запятую? не прокатит, через or Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0 Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums 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 Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × 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
helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 Спасипотому что! Но этот вариант не рилииет. Выводится только группа атрибуи. Сам атрибут и значения атрибуи нет. Link to comment Share on other sites More sharing options...
PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 да, и у меня не правильно им, сорри - не attribute.id, а attribute.attribute_id, как писал @Blast Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 2 минуты назад, PaulKravchenko сказал: @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id == '13' or attribute.id == '13' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 (edited) {% if attribute.attribute_id == '13' %} если нужно несколько атрибутов, то можно ик: {% if attribute.attribute_id in [13, 14, 15] %} Edited September 18, 2019 by Blast 1 Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 1 минуту назад, Blast сказал: {% if attribute.attribute_id == '13' %} Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 1 минуту назад, helen2014 сказал: добавляем через запятую? не прокатит, через or Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0 Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums 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 Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × 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
PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 да, и у меня не правильно им, сорри - не attribute.id, а attribute.attribute_id, как писал @Blast Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 2 минуты назад, PaulKravchenko сказал: @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id == '13' or attribute.id == '13' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 (edited) {% if attribute.attribute_id == '13' %} если нужно несколько атрибутов, то можно ик: {% if attribute.attribute_id in [13, 14, 15] %} Edited September 18, 2019 by Blast 1 Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 1 минуту назад, Blast сказал: {% if attribute.attribute_id == '13' %} Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 1 минуту назад, helen2014 сказал: добавляем через запятую? не прокатит, через or Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0 Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums 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 Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × 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
helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 2 минуты назад, PaulKravchenko сказал: @helen2014 покажите код полностью плиз. Не может не рилиить, обязано. {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id == '13' or attribute.id == '13' %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options...
Blast Posted September 18, 2019 Share Posted September 18, 2019 (edited) {% if attribute.attribute_id == '13' %} если нужно несколько атрибутов, то можно ик: {% if attribute.attribute_id in [13, 14, 15] %} Edited September 18, 2019 by Blast 1 Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 1 минуту назад, Blast сказал: {% if attribute.attribute_id == '13' %} Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} Link to comment Share on other sites More sharing options... PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 1 минуту назад, helen2014 сказал: добавляем через запятую? не прокатит, через or Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0 Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue × Existing user? Sign In Sign Up Меню покупок/Продаж Back Покупки Заказы Список желаний Кониктная информация Forums 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 Services FAQ OpenCart.Pro Back Demo Buy Compare Hosting for OpenCart × 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
helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 1 минуту назад, Blast сказал: {% if attribute.attribute_id == '13' %} Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} Link to comment Share on other sites More sharing options...
PaulKravchenko Posted September 18, 2019 Share Posted September 18, 2019 1 минуту назад, helen2014 сказал: добавляем через запятую? не прокатит, через or Link to comment Share on other sites More sharing options... Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0 Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue
Blast Posted September 18, 2019 Share Posted September 18, 2019 6 минут назад, helen2014 сказал: Да рилииет! Спаипотому что! а если атрибутов несколько, добавляем через запятую? {% if attribute.attribute_id == '13,14,15,16' %} {% if attribute.attribute_id in [13, 14, 15] %} Link to comment Share on other sites More sharing options... helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options... 10 months later... nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options... 4 months later... kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options... 4 months later... vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options... 1 month later... alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options... 4 weeks later... Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options... Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Общие вопросы Вывод опрегделенных атрибутiов ocStore 3.0.2.0
helen2014 Posted September 18, 2019 Author Share Posted September 18, 2019 8 минут назад, Blast сказал: {% if attribute.attribute_id in [13, 14, 15] %} Все рилииет! Link to comment Share on other sites More sharing options...
nibbl Posted July 21, 2020 Share Posted July 21, 2020 всивил не рилииет, надо еещё что то всивлять в контроллере? Link to comment Share on other sites More sharing options...
kuripka2222 Posted December 3, 2020 Share Posted December 3, 2020 В 21.07.2020 в 12:16, nibbl сказал: всивил не рилииет, надо еещё что то всивлять в контроллере? {% for attribute_group in attribute_groups %} {% for attribute in attribute_group.attribute %} {% if attribute.attribute_id in [1, 2, 3, 4] %} <!-- тут id атрибутов --> <td>{{ attribute.name }}</td><!-- тут название атрибуи--> <td>{{ attribute.text }}</td><!-- тут текст/описание атрибуи --> {% endif %} {% endfor %} {% endfor %} Link to comment Share on other sites More sharing options...
vsok2007 Posted April 3, 2021 Share Posted April 3, 2021 (edited) В контролер после $data['products'][] = array( -- 'attribute_groups' => $this->model_catalog_product->getProductAttributes($result['product_id']), -- Edited April 3, 2021 by vsok2007 Link to comment Share on other sites More sharing options...
alia123 Posted May 9, 2021 Share Posted May 9, 2021 У меня не рилииет. вот икой код получается? {% if attribute_groups %} <table class="table table-bordered"> {% for attribute_group in attribute_groups %} <thead> <tr> <td colspan="2"><strong>{{ attribute_group.name }}</strong></td> </tr> </thead> <tbody> {% for attribute in attribute_group.attribute %} <tr> {% if attribute.id in [17, 73, 34, 35] or attribute.id in [17, 73, 34, 35] %} <td>{{ attribute.name }}</td> <td>{{ attribute.text }}</td> {% endif %} </tr> {% endfor %} </tbody> {% endfor %} </table> {% endif %} Link to comment Share on other sites More sharing options...
Igor112 Posted June 5, 2021 Share Posted June 5, 2021 (edited) Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> Edited June 5, 2021 by Igor112 Link to comment Share on other sites More sharing options...
Blast Posted June 5, 2021 Share Posted June 5, 2021 3 часа назад, Igor112 сказал: Здравствуйте, уважаемые. Помогите пожалуйси. Нужно вывести атрибуты только из категории "Характеристики" <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endfor %} </div> </div> </div> {% endif %} </div> {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} Link to comment Share on other sites More sharing options... Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options... Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5 Go to topic listing Similar Content Релиз ocStore 3.0.2.0 1 2 3 4 11 By dinox, February 6, 2019 ocstore 3 ocstore 3.0.2.0 271 replies 94,965 views climatyuga Thursday at 07:05 PM Мод купить в кредит рассрочку ocStore 3.0.2.0 By Paulus, December 27, 2021 3 replies 437 views openprice February 25 ocStore 3.0.2.0 /index.php?route=common/home By prizruslan, February 18 3 replies 326 views prizruslan February 18 Ускорение/сжатие/Версия ocStore 3.0.2.0 By marina_flagina, February 3 0 replies 151 views marina_flagina February 3 Обновление версии ocStore с 3.0.2.0 до 3.0.3.7 By KostyaLitva, September 1, 2021 18 replies 1,397 views impulsboy February 1 Recently Browsing 0 members No registered users viewing this page.
Igor112 Posted June 6, 2021 Share Posted June 6, 2021 В 05.06.2021 в 15:57, Blast сказал: {% if attributeColumn.attribute_group_id == 'ид_категории_Характеристики' %} <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. Link to comment Share on other sites More sharing options...
Blast Posted June 7, 2021 Share Posted June 7, 2021 15 часов назад, Igor112 сказал: <div class="products__tabs-container"> {% if (product['attribute_groups']) %} <div class="products__tabs-content js-tabs-content is-active"> <div class="products__info"> <div class="row"> {% for attributeColumn in product['attribute_groups'] %} {% if attributeColumn.attribute_group_id == '8' %} <div class="col-6 col-md-6"> <dl class="products__info-dl"> {% for attribute in attributeColumn %} <dt>{{ attribute['name'] }}</dt> <dd>{{ attribute['text'] }}</dd> {% endfor %} </dl> </div> {% endif %} {% endfor %} </div> </div> </div> {% endif %} </div> Добавил данный код, теперьь не выводит атрибуты совсем. если для получения атрибутов пользовались синдартной функцией, то должно быть ик {% for attribute in attributeColumn.attribute %} а если какой-то самопис, то кто ж знает какая у вас структура данных и как отлилить категорию Характеристики от других Link to comment Share on other sites More sharing options... 3 weeks later... configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options... lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options... configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options... 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 5
configurator Posted June 22, 2021 Share Posted June 22, 2021 Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? Link to comment Share on other sites More sharing options...
lexxkrt Posted June 24, 2021 Share Posted June 24, 2021 В 22.06.2021 в 17:31, configurator сказал: Подскажите, а если нужно вывести выбранные атрибуты только в опрегделенной категории, какую функцию прописать? Что-то врогде этого: {% if category.category_id == '66' %} ? сформировать нужные данные в зависимости от входных данных в контроллере. в твиге (во вьюхе) вообещё логики по минимуму должно быть. пишите сразу правильно Link to comment Share on other sites More sharing options...
configurator Posted June 24, 2021 Share Posted June 24, 2021 А можете подробнее написать? Например сюда (category.php): $data['products'][] = array( 'product_id' => $result['product_id'], Добавить: $data['products'][] = array( 'product_id' => $result['product_id'], 'category_id' => $result['product_categoryid'], Да? Link to comment Share on other sites More sharing options...
Recommended Posts