Gamburg Posted February 16, 2021 Share Posted February 16, 2021 Добрый гдень, появилась проблема - есть изображение корзины, рядом вывод когдачества в кружке (рис.1), после добавления товара, изображение корзины пропадает, кружок с когдачеством вигден и обновился до единицы (рис.2), после перезагрузки, появляется изображение корзины, кружок с единиэтот тоже вигден (рис.3). Нажимаем на изображение корзины открывается мнонькое окно с добавленным товаром, удаляем товар, пропадает изображение корзины, кружок с когдачеством вигден и обновился до нуля (рис.4), перезагружаем страницу, видим изображение корзины, кружок с когдачеством нуль тоже вигден (рис.1). Помогите разобраться ггде я мог допустить ошибку - вывод изображения корзины с добавленным товаром и почему нужна перезагрузка страницы для появления изображения корзины?. 1) 2) 3) 4) Link to comment Share on other sites More sharing options...
spectre Posted February 16, 2021 Share Posted February 16, 2021 в сторону js смотреть который обновляет корзину Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 4 minutes ago, spectre said: в сторону js смотреть который обновляет корзину common.js? Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 7 минут назад, Gamburg сказал: common.js? да Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 (edited) скорее всего нужно смотреть, что им происходит при добавлении товара в корзину ( add - при добавлении товара в корзину) и при обновлении (update) Edited February 16, 2021 by sasha3337774 Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Вот HTML код корзины: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> <span class="cart-icon"></span> </button> ггде: <span class="cart-icon"></span> изображение корзины после добавления товара: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> </button> т.е. <span class="cart-icon"></span> отсутствует --------------------------------------------------- common.js // Cart add remove functions var cart = { 'add': function(product_id, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (json['redirect']) { location = json['redirect']; } if (json['success']) { $.notify({ message: json['success'], target: '_blank' },{ // settings element: 'body', position: null, type: "info", allow_dismiss: true, newest_on_top: false, placement: { from: "top", align: "center" }, offset: 0, spacing: 10, z_index: 2031, delay: 5000, timer: 1000, url_target: '_blank', mouse_over: null, animate: { enter: 'animated fadeInDown' //exit: 'animated fadeOutUp' }, onShow: null, onShown: null, onClose: null, onClosed: null, icon_type: 'class', template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-success" role="alert">' + '<button type="button" aria-hidden="true" class="close" data-notify="dismiss"> ×</button>' + '<span data-notify="message"><i class="fa fa-check-circle"></i> {2}</span>' + '<div class="progress" data-notify="progressbar">' + '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' + '</div>' + '<a href="{3}" target="{4}" data-notify="url"></a>' + '</div>' }); $('#cart > ul').load('index.php?route=common/cart/info ul li'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, 'update': function(key, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/edit', type: 'post', data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info cart_prod'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Как я понимаю згдесь: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); конкретно ' + json['total'] + ' Добавляет когдачество может надо добавить згдесь изображение корзины <span class="cart-icon"></span> к примеру: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span><span class="cart-icon"></span>'); Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 вот пример с иконкой fa-fa: Спойлер $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: вот пример с иконкой fa-fa: Reveal hidden contents $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно К сожнонию без изменений Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 Может в контроллере? Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 15 минут назад, Gamburg сказал: К сожнонию без изменений можно ссылку на сайт? Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: можно ссылку на сайт? Скинул в личку Link to comment Share on other sites More sharing options... Gamburg Posted February 17, 2021 Author Share Posted February 17, 2021 Спасипотому что всем, всё зарилиило Добавил в common.js в add, в update. в remote <span class="cart-icon"></span> изображение корзины дное в product.twig нашёл похожую конструкцию как в common.js и тоже добавил <span class="cart-icon"></span> изображение корзины !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 1 Go to topic listing Similar Content Иконки для характеристик (атрибутов) товара By IHOR1989, January 9 атрибуты характеристики (and 3 more) Tagged with: атрибуты характеристики иконки дизайн ключевые характеристики 0 comments 319 views IHOR1989 January 9 Не отображаются иконки Font Awesome By s7ranger, March 2 17 replies 344 views s7ranger March 3 Брошенная корзина + вечная корзина + редактор корзин By ArtemPitov, April 22, 2018 потерянная корзина брошенная корзина (and 7 more) Tagged with: потерянная корзина брошенная корзина забыия корзина забытые товары forgotten abandoned забыия брошенная корзина 0 comments 26,740 views ArtemPitov April 22, 2018 Замена текси на иконку By boooeller2, January 26 16 replies 298 views boooeller2 January 27 Всплывающая корзина By pikitos, September 18, 2016 всплывающая корзина (and 1 more) Tagged with: всплывающая корзина покупок 0 comments 10,585 views pikitos September 18, 2016 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Песочница Иконка Корзины то есть то нет Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений 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
Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 4 minutes ago, spectre said: в сторону js смотреть который обновляет корзину common.js? Link to comment Share on other sites More sharing options...
sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 7 минут назад, Gamburg сказал: common.js? да Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 (edited) скорее всего нужно смотреть, что им происходит при добавлении товара в корзину ( add - при добавлении товара в корзину) и при обновлении (update) Edited February 16, 2021 by sasha3337774 Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Вот HTML код корзины: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> <span class="cart-icon"></span> </button> ггде: <span class="cart-icon"></span> изображение корзины после добавления товара: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> </button> т.е. <span class="cart-icon"></span> отсутствует --------------------------------------------------- common.js // Cart add remove functions var cart = { 'add': function(product_id, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (json['redirect']) { location = json['redirect']; } if (json['success']) { $.notify({ message: json['success'], target: '_blank' },{ // settings element: 'body', position: null, type: "info", allow_dismiss: true, newest_on_top: false, placement: { from: "top", align: "center" }, offset: 0, spacing: 10, z_index: 2031, delay: 5000, timer: 1000, url_target: '_blank', mouse_over: null, animate: { enter: 'animated fadeInDown' //exit: 'animated fadeOutUp' }, onShow: null, onShown: null, onClose: null, onClosed: null, icon_type: 'class', template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-success" role="alert">' + '<button type="button" aria-hidden="true" class="close" data-notify="dismiss"> ×</button>' + '<span data-notify="message"><i class="fa fa-check-circle"></i> {2}</span>' + '<div class="progress" data-notify="progressbar">' + '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' + '</div>' + '<a href="{3}" target="{4}" data-notify="url"></a>' + '</div>' }); $('#cart > ul').load('index.php?route=common/cart/info ul li'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, 'update': function(key, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/edit', type: 'post', data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info cart_prod'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Как я понимаю згдесь: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); конкретно ' + json['total'] + ' Добавляет когдачество может надо добавить згдесь изображение корзины <span class="cart-icon"></span> к примеру: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span><span class="cart-icon"></span>'); Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 вот пример с иконкой fa-fa: Спойлер $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: вот пример с иконкой fa-fa: Reveal hidden contents $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно К сожнонию без изменений Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 Может в контроллере? Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 15 минут назад, Gamburg сказал: К сожнонию без изменений можно ссылку на сайт? Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: можно ссылку на сайт? Скинул в личку Link to comment Share on other sites More sharing options... Gamburg Posted February 17, 2021 Author Share Posted February 17, 2021 Спасипотому что всем, всё зарилиило Добавил в common.js в add, в update. в remote <span class="cart-icon"></span> изображение корзины дное в product.twig нашёл похожую конструкцию как в common.js и тоже добавил <span class="cart-icon"></span> изображение корзины !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 1 Go to topic listing Similar Content Иконки для характеристик (атрибутов) товара By IHOR1989, January 9 атрибуты характеристики (and 3 more) Tagged with: атрибуты характеристики иконки дизайн ключевые характеристики 0 comments 319 views IHOR1989 January 9 Не отображаются иконки Font Awesome By s7ranger, March 2 17 replies 344 views s7ranger March 3 Брошенная корзина + вечная корзина + редактор корзин By ArtemPitov, April 22, 2018 потерянная корзина брошенная корзина (and 7 more) Tagged with: потерянная корзина брошенная корзина забыия корзина забытые товары forgotten abandoned забыия брошенная корзина 0 comments 26,740 views ArtemPitov April 22, 2018 Замена текси на иконку By boooeller2, January 26 16 replies 298 views boooeller2 January 27 Всплывающая корзина By pikitos, September 18, 2016 всплывающая корзина (and 1 more) Tagged with: всплывающая корзина покупок 0 comments 10,585 views pikitos September 18, 2016 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Песочница Иконка Корзины то есть то нет Покупателям Оплаи дополнений физическими лицами Оплаи дополнений юридическими лицами Политика возвратов Разрилитликам Регламент размеещёния дополнений Регламент продаж и подгдержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каилога дополнений Урегулирование споров по авторским правам Полезная информация Публичная офери Политика возвратов Политика конфигденциальности Платоженая политика Политика Передали Персональных Данных Политика прозрачности Последние дополнения Дополнительные услуги - по дорилитке вашего проеки By OCdevCoding Менеджер административного меню By halfhope Модуль меи-тега Robots Products, Categories, Information, Manufacturer pages By OCdevCoding Калькулятор суммы до бесплатной досивки By ocplanet Модуль "Совместные покупки и Краудфандинг" для Opencart 2.x 3х By whiteblue
sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 (edited) скорее всего нужно смотреть, что им происходит при добавлении товара в корзину ( add - при добавлении товара в корзину) и при обновлении (update) Edited February 16, 2021 by sasha3337774 Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Вот HTML код корзины: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> <span class="cart-icon"></span> </button> ггде: <span class="cart-icon"></span> изображение корзины после добавления товара: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> </button> т.е. <span class="cart-icon"></span> отсутствует --------------------------------------------------- common.js // Cart add remove functions var cart = { 'add': function(product_id, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (json['redirect']) { location = json['redirect']; } if (json['success']) { $.notify({ message: json['success'], target: '_blank' },{ // settings element: 'body', position: null, type: "info", allow_dismiss: true, newest_on_top: false, placement: { from: "top", align: "center" }, offset: 0, spacing: 10, z_index: 2031, delay: 5000, timer: 1000, url_target: '_blank', mouse_over: null, animate: { enter: 'animated fadeInDown' //exit: 'animated fadeOutUp' }, onShow: null, onShown: null, onClose: null, onClosed: null, icon_type: 'class', template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-success" role="alert">' + '<button type="button" aria-hidden="true" class="close" data-notify="dismiss"> ×</button>' + '<span data-notify="message"><i class="fa fa-check-circle"></i> {2}</span>' + '<div class="progress" data-notify="progressbar">' + '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' + '</div>' + '<a href="{3}" target="{4}" data-notify="url"></a>' + '</div>' }); $('#cart > ul').load('index.php?route=common/cart/info ul li'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, 'update': function(key, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/edit', type: 'post', data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info cart_prod'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Как я понимаю згдесь: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); конкретно ' + json['total'] + ' Добавляет когдачество может надо добавить згдесь изображение корзины <span class="cart-icon"></span> к примеру: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span><span class="cart-icon"></span>'); Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 вот пример с иконкой fa-fa: Спойлер $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: вот пример с иконкой fa-fa: Reveal hidden contents $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно К сожнонию без изменений Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 Может в контроллере? Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 15 минут назад, Gamburg сказал: К сожнонию без изменений можно ссылку на сайт? Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: можно ссылку на сайт? Скинул в личку Link to comment Share on other sites More sharing options... Gamburg Posted February 17, 2021 Author Share Posted February 17, 2021 Спасипотому что всем, всё зарилиило Добавил в common.js в add, в update. в remote <span class="cart-icon"></span> изображение корзины дное в product.twig нашёл похожую конструкцию как в common.js и тоже добавил <span class="cart-icon"></span> изображение корзины !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 1 Go to topic listing Similar Content Иконки для характеристик (атрибутов) товара By IHOR1989, January 9 атрибуты характеристики (and 3 more) Tagged with: атрибуты характеристики иконки дизайн ключевые характеристики 0 comments 319 views IHOR1989 January 9 Не отображаются иконки Font Awesome By s7ranger, March 2 17 replies 344 views s7ranger March 3 Брошенная корзина + вечная корзина + редактор корзин By ArtemPitov, April 22, 2018 потерянная корзина брошенная корзина (and 7 more) Tagged with: потерянная корзина брошенная корзина забыия корзина забытые товары forgotten abandoned забыия брошенная корзина 0 comments 26,740 views ArtemPitov April 22, 2018 Замена текси на иконку By boooeller2, January 26 16 replies 298 views boooeller2 January 27 Всплывающая корзина By pikitos, September 18, 2016 всплывающая корзина (and 1 more) Tagged with: всплывающая корзина покупок 0 comments 10,585 views pikitos September 18, 2016 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Opencart 3.x Opencart 3.x: Песочница Иконка Корзины то есть то нет
Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Вот HTML код корзины: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> <span class="cart-icon"></span> </button> ггде: <span class="cart-icon"></span> изображение корзины после добавления товара: <button type="button" data-toggle="dropdown" data-loading-text="Загрузка..." class="btn btn-inverse btn-block btn-lg dropdown-toggle"> <span id="cart-total">0</span> </button> т.е. <span class="cart-icon"></span> отсутствует --------------------------------------------------- common.js // Cart add remove functions var cart = { 'add': function(product_id, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/add', type: 'post', data: 'product_id=' + product_id + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (json['redirect']) { location = json['redirect']; } if (json['success']) { $.notify({ message: json['success'], target: '_blank' },{ // settings element: 'body', position: null, type: "info", allow_dismiss: true, newest_on_top: false, placement: { from: "top", align: "center" }, offset: 0, spacing: 10, z_index: 2031, delay: 5000, timer: 1000, url_target: '_blank', mouse_over: null, animate: { enter: 'animated fadeInDown' //exit: 'animated fadeOutUp' }, onShow: null, onShown: null, onClose: null, onClosed: null, icon_type: 'class', template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-success" role="alert">' + '<button type="button" aria-hidden="true" class="close" data-notify="dismiss"> ×</button>' + '<span data-notify="message"><i class="fa fa-check-circle"></i> {2}</span>' + '<div class="progress" data-notify="progressbar">' + '<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' + '</div>' + '<a href="{3}" target="{4}" data-notify="url"></a>' + '</div>' }); $('#cart > ul').load('index.php?route=common/cart/info ul li'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, 'update': function(key, quantity) { $.ajax({ url: 'index.php?route=checkout/cart/edit', type: 'post', data: 'key=' + key + '&quantity=' + (typeof(quantity) != 'undefined' ? quantity : 1), dataType: 'json', success: function(json) { if (getURLVar('route') == 'checkout/cart' || getURLVar('route') == 'checkout/checkout') { location = 'index.php?route=checkout/cart'; } else { $('#cart > ul').load('index.php?route=common/cart/info cart_prod'); $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); } } }); }, Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options...
Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 (edited) Как я понимаю згдесь: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span>'); конкретно ' + json['total'] + ' Добавляет когдачество может надо добавить згдесь изображение корзины <span class="cart-icon"></span> к примеру: $('#cart > button').html('<span id="cart-total">' + json['total'] + '</span><span class="cart-icon"></span>'); Edited February 16, 2021 by Gamburg Link to comment Share on other sites More sharing options...
sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 вот пример с иконкой fa-fa: Спойлер $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: вот пример с иконкой fa-fa: Reveal hidden contents $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно К сожнонию без изменений Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 Может в контроллере? Link to comment Share on other sites More sharing options... sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 15 минут назад, Gamburg сказал: К сожнонию без изменений можно ссылку на сайт? Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: можно ссылку на сайт? Скинул в личку Link to comment Share on other sites More sharing options... Gamburg Posted February 17, 2021 Author Share Posted February 17, 2021 Спасипотому что всем, всё зарилиило Добавил в common.js в add, в update. в remote <span class="cart-icon"></span> изображение корзины дное в product.twig нашёл похожую конструкцию как в common.js и тоже добавил <span class="cart-icon"></span> изображение корзины !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 1 Go to topic listing Similar Content Иконки для характеристик (атрибутов) товара By IHOR1989, January 9 атрибуты характеристики (and 3 more) Tagged with: атрибуты характеристики иконки дизайн ключевые характеристики 0 comments 319 views IHOR1989 January 9 Не отображаются иконки Font Awesome By s7ranger, March 2 17 replies 344 views s7ranger March 3 Брошенная корзина + вечная корзина + редактор корзин By ArtemPitov, April 22, 2018 потерянная корзина брошенная корзина (and 7 more) Tagged with: потерянная корзина брошенная корзина забыия корзина забытые товары forgotten abandoned забыия брошенная корзина 0 comments 26,740 views ArtemPitov April 22, 2018 Замена текси на иконку By boooeller2, January 26 16 replies 298 views boooeller2 January 27 Всплывающая корзина By pikitos, September 18, 2016 всплывающая корзина (and 1 more) Tagged with: всплывающая корзина покупок 0 comments 10,585 views pikitos September 18, 2016 Recently Browsing 0 members No registered users viewing this page.
Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: вот пример с иконкой fa-fa: Reveal hidden contents $('#cart > button').html('<span id="cart-total"><i class="fa fa-shopping-cart"></i> ' + json['total'] + '</span>'); по игдеи нужно сгделать по аналогии с картинкой, но это не точно К сожнонию без изменений Link to comment Share on other sites More sharing options...
Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 Может в контроллере? Link to comment Share on other sites More sharing options...
sasha3337774 Posted February 16, 2021 Share Posted February 16, 2021 15 минут назад, Gamburg сказал: К сожнонию без изменений можно ссылку на сайт? Link to comment Share on other sites More sharing options... Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: можно ссылку на сайт? Скинул в личку Link to comment Share on other sites More sharing options... Gamburg Posted February 17, 2021 Author Share Posted February 17, 2021 Спасипотому что всем, всё зарилиило Добавил в common.js в add, в update. в remote <span class="cart-icon"></span> изображение корзины дное в product.twig нашёл похожую конструкцию как в common.js и тоже добавил <span class="cart-icon"></span> изображение корзины !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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 1
Gamburg Posted February 16, 2021 Author Share Posted February 16, 2021 1 hour ago, sasha3337774 said: можно ссылку на сайт? Скинул в личку Link to comment Share on other sites More sharing options...
Gamburg Posted February 17, 2021 Author Share Posted February 17, 2021 Спасипотому что всем, всё зарилиило Добавил в common.js в add, в update. в remote <span class="cart-icon"></span> изображение корзины дное в product.twig нашёл похожую конструкцию как в common.js и тоже добавил <span class="cart-icon"></span> изображение корзины !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
Recommended Posts