Lemuba Posted July 31, 2024 at 11:29 AM Share Posted July 31, 2024 at 11:29 AM Всем привет! Появилась необходимость сделать следующее: Например как на Озоне, добавил товар в корзину, а при повторном нажатии на кнопку "В корзину" был бы переход в саму корзину а не добавление товара в корзину. Может кто знает как это сделать? Или модуль может какой то есть? Заранее всем спасибо! 0 Quote Link to comment Share on other sites More sharing options...
Solution Blast Posted July 31, 2024 at 12:50 PM Solution Share Posted July 31, 2024 at 12:50 PM $(document).on('click', '[onclick^="cart.add"]', function(){ $(this).attr('onclick', 'window.location="/index.php?route=checkout/cart"'); }) для каталога/категорий/модулей $('#button-cart').on('click', function(){ $(this).off().on('click', function(){window.location="/index.php?route=checkout/cart"}); }); для карточки товара скрипты можно вставить в catalog/view/javascript/common.js или в подобный js файл шаблона 1 Quote Link to comment Share on other sites More sharing options...
Lemuba Posted July 31, 2024 at 03:16 PM Author Share Posted July 31, 2024 at 03:16 PM В 31.07.2024 в 15:50, Blast сказал: $(document).on('click', '[onclick^="cart.add"]', function(){ $(this).attr('onclick', 'window.location="/index.php?route=checkout/cart"'); }) для каталога/категорий/модулей $('#button-cart').on('click', function(){ $(this).off().on('click', function(){window.location="/index.php?route=checkout/cart"}); }); для карточки товара скрипты можно вставить в catalog/view/javascript/common.js или в подобный js файл шаблона Круто! Спасибо большое! Теперь при повторном нажатии переходит в корзину! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.