PageSourceSearch

https://rwandamart.rw/wp-content/plugins/bacola-core/woocommerce-filter/notice-ajax/js/notice-ajax.js?ver=1.0

js rwandamart.rw collected 2026-10-02 23:51:29 UTC 1,871 bytes, 74 lines download raw bytes

1(function ($) {
2  "use strict";
3
4	$(document).on('bacolaNoticeAjaxInit', function () {
5		woocommerceNoticeAjax();
6	});
7
8	function woocommerceNoticeAjax() {
9		
10		// Klb Notice
11		$('body').append('<div class="klb-notice-ajax"></div>');
12		
13		// AJax single add to cart
14		$(document).on('click', 'a.ajax_add_to_cart', function(e){
15			e.preventDefault();
16
17			var $thisbutton = $(this);
18
19			var formData = new FormData();
20			formData.append('add-to-cart', $thisbutton.attr( 'data-product_id' ));
21
22			// Trigger event.
23			$( document.body ).trigger( 'adding_to_cart', [ $thisbutton, formData ] );
24
25			// Ajax action.
26			$.ajax({
27				url: wc_add_to_cart_params.wc_ajax_url.toString().replace( '%%endpoint%%', 'bacola_add_to_cart_archive' ),
28				data: formData,
29				type: 'POST',
30				processData: false,
31				contentType: false,
32				success: function( response ) {
33					if ( ! response ) {
34						return;
35					}
36
37					if ( response.error && response.product_url ) {
38						window.location = response.product_url;
39						return;
40					}
41
42					// Redirect to cart option
43					if ( wc_add_to_cart_params.cart_redirect_after_add === 'yes' ) {
44						window.location = wc_add_to_cart_params.cart_url;
45						return;
46					}
47					
48					$(response.fragments.notices_html).appendTo('.klb-notice-ajax').delay(3000).fadeOut(300, function(){ $(this).remove();});
49
50					//Close icon
51					$('.woocommerce-message, .woocommerce-error').append('<div class="klb-notice-close"><i class="klbth-icon-cancel"></i></div>');
52					$('.klb-notice-close').on('click', function(){
53						$(this).closest('.woocommerce-message, .woocommerce-error').remove();
54					});
55					
56					if (response.fragments.notices_html.indexOf('woocommerce-error') > -1)
57					{
58					  window.stop();
59					}
60
61				},
62				dataType: 'json'
63
64			});
65			
66
67		});
68	}
69	
70	$(document).ready(function() {
71		woocommerceNoticeAjax();
72	});
73	
74}(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.