1jQuery(function($) { 2 let cartOpened = false; 3 4 // ÐбеÑÑгаÑмо ID пÑодÑкÑÑ, Ñкий бÑв наÑиÑнÑÑий 5 let lastClickedProductId = null; 6 7 // СлÑдкÑÑмо за клÑком по кнопÑÑ "додаÑи в коÑик" 8 $(document.body).on('click', '.ajax_add_to_cart', function(e) { 9 const $btn = $(this); 10 lastClickedProductId = $btn.data('product_id'); 11 cartOpened = false; // ÑкидаÑмо Ñлаг пÑи ÐºÐ¾Ð¶Ð½Ð¾Ð¼Ñ Ð½Ð¾Ð²Ð¾Ð¼Ñ ÐºÐ»ÑÐºÑ 12 }); 13 14 // СлÑÑ Ð°Ñмо подÑÑ, ÑÐºÑ WooCommerce Ð²Ð¸ÐºÐ»Ð¸ÐºÐ°Ñ Ð¿ÑÑÐ»Ñ ÑÑпÑÑного Ð´Ð¾Ð´Ð°Ð²Ð°Ð½Ð½Ñ 15 $(document.body).on('added_to_cart', function(event, fragments, cart_hash, $button) { 16 // ÐеÑевÑÑÑÑмо, Ñи Ñе кнопка Ñого Ñамого пÑодÑкÑÑ, Ñкий ми наÑиÑкали 17 if (!cartOpened && $button && $button.data('product_id') === lastClickedProductId) { 18 $('body').addClass('display-cart'); 19 cartOpened = true; 20 } 21 }); 22});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.