Ecommerce Shopify WordPress Discussion

Failed to execute 'fetch' on 'Window': 1 argument required, but only 0 present

I have a multi-vendor store where every vendor has his own dashboard. There is a product tab in dashboard to view their products and they can edit them. I added a search bar to update their list based on the keyword they are trying to find. Recently this search bar is stuck on "Please wait.." and doesn't update the list. I tried to disable some of the recent updates I made but nothing works. Also, I shows this error in Chrome inspect tool. Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': 1 argument required, but only 0 present. at HTMLInputElement.onkeyup Here is the code of the products list <?php global $products; global $edd_logs; global $post; ?> <?php echo EDD_FES()->dashboard->product_list_status_bar(); ?> <div class="row"> <div class="col-12 col-md-6"> <h3 class="fes-headers" id="mayofes-orders-page-title"><?php echo EDD_FES()->helper->get_product_constant_name( $plural = true, $uppercase = true ) ?></h3> </div> <div class="col-12 col-md-6"> <div class="fes-cs-search_bar"> <form action="/" method="get" autocomplete="off"> <input type="text" name="s" placeholder="Search Products..." id="keyword" class="input_search" onkeyup="fetch()"> </form> </div> </div> </div> <div class="search_result" id="datafetch"> <ul> <li>Please wait..</li> </ul> </div> <div class="fes--list--style-p" id="fes-product-list"> <?php if ( count( $products ) > 0 ) { foreach ( $products as $product ) : ?> <div class="product--flex--fes"> <div class = "fes-product-list-td fes--mob--image"><?php echo get_the_post_thumbnail( $product->ID, array( 100, 100,true ) ); ?></div> <div class = "fes-product-list-td fes--mob--title"><?php echo EDD_FES()->dashboard->product_list_title( $product->ID ); ?></div> <div class = "fes-product-list-td"><?php echo EDD_FES()->dashboard->product_list_status( $product->ID ); ?></div> <div class = "fes-product-list-td"><?php $download = $edd_logs->get_log_count($product->ID, 'file_download'); echo ( is_null( $download ) ? '0' : $download ); ?> <?php esc_html_e('Downloads','mayosis'); ?></div> <div class = "fes-product-list-td"><?php EDD_FES()->dashboard->product_list_actions( $product->ID ); ?></div> <div class = "fes-product-list-td"><?php echo EDD_FES()->dashboard->product_list_date( $product->ID ); ?></div> <?php do_action( 'fes-product-table-column-value', $product ); ?> </div> <?php endforeach; } else { echo '<div><div class = "fes-product-list-td" >' . sprintf( _x( 'No %s found', 'FES lowercase plural setting for download','mayosis' ), EDD_FES()->helper->get_product_constant_name( $plural = true, $uppercase = false ) ) . '</div></div>'; } ?> </div> <?php EDD_FES()->dashboard->product_list_pagination(); And below is the function.php code related to the above code <script type="text/javascript"> function fetch(){ jQuery.ajax({ url: '<?php echo admin_url('admin-ajax.php'); ?>', type: 'post', data: { action: 'data_fetch', keyword: jQuery('#keyword').val() }, success: function(data) { jQuery('#datafetch').html( data ); } }); } </script> <?php } // the ajax function add_action('wp_ajax_data_fetch' , 'data_fetch'); add_action('wp_ajax_nopriv_data_fetch','data_fetch'); function data_fetch(){ $authorID = get_current_user_id(); $the_query = new WP_Query( array( 'posts_per_page' => -1, 's' => esc_attr( $_POST['keyword'] ), 'post_type' => 'download', 'author'=> $authorID ) ); if( $the_query->have_posts() ) : while( $the_query->have_posts() ): $the_query->the_post(); global $products; global $edd_logs; global $post; ?> <div class="product--flex--fes"> <div class = "fes-product-list-td fes--mob--image"><?php echo get_the_post_thumbnail( $product->ID, array( 100, 100,true ) ); ?></div> <div class = "fes-product-list-td fes--mob--title"><?php echo EDD_FES()->dashboard->product_list_title( $product->ID ); ?></div> <div class = "fes-product-list-td"><?php echo EDD_FES()->dashboard->product_list_status( $product->ID ); ?></div> <div class = "fes-product-list-td"><?php $download = $edd_logs->get_log_count($product->ID, 'file_download'); echo ( is_null( $download ) ? '0' : $download ); ?> <?php esc_html_e('Downloads','mayosis'); ?></div> <div class = "fes-product-list-td"><?php EDD_FES()->dashboard->product_list_actions( $product->ID ); ?></div> <div class = "fes-product-list-td"><?php echo EDD_FES()->dashboard->product_list_date( $product->ID ); ?></div> </div> <?php endwhile; wp_reset_postdata(); else : echo "No Product Found"; endif; die(); }
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.