1(function ($) { 2 $(document).on("mouseenter", ".yaydp-tooltip-icon", function () { 3 const tooltip = $(this).find(".yaydp-tooltip-content"); 4 if (tooltip.length < 1) { 5 return; 6 } 7 const { left } = tooltip.offset(); 8 const width = tooltip.width(); 9 console.log(width, left); 10 if (width + left > window.outerWidth) { 11 tooltip.css("left", window.outerWidth - width - left - 30); 12 } 13 if (left < 0) { 14 tooltip.css("left", 30); 15 } 16 }); 17 18 $(document).ready(function () { 19 if (!window.elementorFrontend || !window.elementorFrontend.getElements) { 20 return; 21 } 22 const menuCarts = window.elementorFrontend 23 ?.getElements() 24 ?.$body?.find(".elementor-widget-woocommerce-menu-cart"); 25 menuCarts.each((_, el) => { 26 const settings = $(el).data("settings"); 27 if (!settings) { 28 return; 29 } 30 if (settings.automatically_open_cart == null) { 31 return; 32 } 33 const currentValue = settings.automatically_open_cart; 34 settings.automatically_open_cart = "no"; 35 $(el).data("settings", settings); 36 setTimeout(() => { 37 settings.automatically_open_cart = currentValue; 38 $(el).data("settings", settings); 39 }, 1000); 40 }); 41 }); 42 43 /** 44 * Integrate with YayExtra product total 45 */ 46 if (!window.wp?.hooks?.addFilter) { 47 return; 48 } 49 window.wp.hooks.addFilter( 50 "yaye_total_price_hook", 51 "yaydp", 52 function (html, total) { 53 const extraTotalPrice = $(".yayextra-total-price"); 54 if (extraTotalPrice.closest(".product").length < 1) { 55 return html; 56 } 57 const yaydpDiscountedData = extraTotalPrice 58 .closest(".single-product-wrapper") 59 .find(".yaydp-product-discounted-data"); 60 if (yaydpDiscountedData.length < 1) { 61 return html; 62 } 63 64 const minRate = yaydpDiscountedData.data("min-rate"); 65 const maxRate = yaydpDiscountedData.data("min-rate"); 66 67 if (minRate >= 1) { 68 return html; 69 } 70 71 const discounted = total * minRate; 72 73 function formatPrice(price) { 74 window.accounting.settings.currency.symbol = 75 window.yaydp_frontend_data.currency_settings.symbol; 76 window.accounting.settings.currency.decimal = 77 window.yaydp_frontend_data.currency_settings.decimalSeparator; 78 window.accounting.settings.currency.thousand = 79 window.yaydp_frontend_data.currency_settings.thousandSeparator; 80 window.accounting.settings.currency.precision = 81 window.yaydp_frontend_data.currency_settings.precision; 82 return ` 83 <span class="woocommerce-Price-amount amount">${window.accounting.formatMoney( 84 price 85 )}</span> 86 `; 87 } 88 89 return ` 90 <del>${formatPrice(total)}</del> 91 ${formatPrice(discounted)}`; 92 } 93 ); 94})(window.jQuery);
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.