1/** If user is logged out, adjust my-account navigation link title. */ 2jQuery(document).ready(function($) { 3 $('body.logged-in nav li.my-account-link a').html('Mein <b>MINT</b> <i>Zirkel</i>'); 4}); 5 6/** Werbebanner: add Class to a **/ 7 8document.addEventListener('DOMContentLoaded', () => { 9 const link = document.querySelector('.startseite_werbebanner a.jet-engine-listing-overlay-link'); 10 if (link) { 11 link.id = 'track_home'; 12 } 13 14 const linkunter = document.querySelector('.unterricht_werbebanner a.jet-engine-listing-overlay-link'); 15 if (linkunter) { 16 linkunter.id = 'track_material'; 17 } 18 19 const linkblog = document.querySelector('.blog_werbebanner a.jet-engine-listing-overlay-link'); 20 if (linkblog) { 21 linkblog.id = 'track_blog'; 22 } 23 24 const linkmzsidebar = document.querySelector('.mz-sidebar-wrapper a.jet-engine-listing-overlay-link'); 25 if (linkmzsidebar) { 26 linkmzsidebar.id = 'track_mzsidebar'; 27 } 28 29 const linkmzhero = document.querySelector('.woocommerce-MyAccount-content a.jet-engine-listing-overlay-link'); 30 if (linkmzhero) { 31 linkmzhero.id = 'track_mzhero'; 32 } 33 34}); 35 36/** 37 * Apply-coupon handler for the checkout page. 38 * 39 * The coupon form has been moved into the checkout review block 40 * (see functions.php / lib/templates/woocommerce/checkout/form-coupon.php), 41 * which means it now sits *inside* the main <form class="checkout">. 42 * As a side effect, it can no longer be its own <form> (HTML5 forbids 43 * nested forms) and submitting it as a form is not possible. WC core 44 * also doesn't ship an apply-coupon click handler on the checkout page 45 * (only on cart). We add one here. 46 */ 47jQuery(function($) { 48 $(document.body).on('click', '.checkout_coupon button[name="apply_coupon"]', function(evt) { 49 evt.preventDefault(); 50 51 if (typeof wc_checkout_params === 'undefined') { 52 return; 53 } 54 55 var $btn = $(this); 56 var $box = $btn.closest('.checkout_coupon'); 57 if ($box.is('.processing')) { 58 return; 59 } 60 61 $box.addClass('processing').block({ 62 message: null, 63 overlayCSS: { background: '#fff', opacity: 0.6 } 64 }); 65 66 $.ajax({ 67 type: 'POST', 68 url: wc_checkout_params.wc_ajax_url.toString().replace('%%endpoint%%', 'apply_coupon'), 69 data: { 70 security: wc_checkout_params.apply_coupon_nonce, 71 coupon_code: $('#coupon_code').val() 72 }, 73 dataType: 'html', 74 success: function(response) { 75 $('.woocommerce-error, .woocommerce-message').remove(); 76 $box.removeClass('processing').unblock(); 77 78 if (response) { 79 $box.before(response); 80 $box.slideUp(); 81 $(document.body).trigger('applied_coupon_in_checkout', [$('#coupon_code').val()]); 82 $(document.body).trigger('update_checkout', { update_shipping_method: false }); 83 } 84 }, 85 error: function() { 86 $box.removeClass('processing').unblock(); 87 } 88 }); 89 }); 90});
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.