Store List

jQuery( document ).ready( function ( $ ) { var form = $( '.dokan-seller-search-form' ); var xhr; var timer = null; form.on( 'dokan_seller_search', function () { if ( timer ) { clearTimeout( timer ); } if ( xhr ) { xhr.abort(); } var data = { pagination_base: form.find('#pagination_base').val(), per_row: '3', action: 'dokan_seller_listing_search', _wpnonce: form.find('#nonce').val() }; form.trigger( 'dokan_seller_search_populate_data', data ); timer = setTimeout(function() { form.find('.dokan-overlay').show(); xhr = $.post( dokan.ajaxurl, data, function( response ) { if ( response.success ) { form.find('.dokan-overlay').hide(); var data = response.data; $('#dokan-seller-listing-wrap').html( $(data).find( '.seller-listing-content' ) ); } } ); }, 500 ); } ); form.on( 'dokan_seller_search_populate_data', function ( e, data ) { data.search_term = form.find( '#search' ).val(); } ); form.on( 'keyup', '#search', function() { form.trigger( 'dokan_seller_search' ); } ); } );

2018 Powered By Wordpress