Home Forums WoodMart support forum Woodmart elementor widgets issue

Woodmart elementor widgets issue

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #661283

    [email protected]
    Participant

    We are facing a big issue with the woodmart elementor widgets.

    When we try to choose which taxonomies we’d like to show on a products carousel, or an AJAX products tab, the result is always “No results”.

    Searching for whatever term of whatever taxonomy, nothing is found.

    If we use the generic elementor widget for products, it returns the taxonomies as it should.

    The only plugins left on the site right now is Woocommerce and Elementor.
    Everything else is deactivated.

    #661362

    Hung Pham
    Keymaster

    Hello [email protected],

    Thanks for reaching to us.

    Could you please record a short video and describe how we can reproduce the issue on your website so we can check this for you?

    Thanks for your patience.

    Regards,

    #661369

    [email protected]
    Participant

    Here is the video you requested:

    http://staging.callofbeautypro.com/wp-content/uploads/2025/05/woodmart.mp4

    As you can see, no matter the term we search for in the woodmart widget, no results are returned.

    This may be a staging site, but the live site has the same issue and the client is requesting some changes but we’re unable to proceed with those due to this issue.

    So it is kind of urgent for us and we’d appreciate an immediate response.

    Thank you in advance.

    #661482

    Hung Pham
    Keymaster

    Hello [email protected],

    I’ve passed this topic to one of our developers, and I will let you know once get an answer.

    Thanks for your patience.

    Best Regards,

    #661672

    Hung Pham
    Keymaster

    Hello [email protected],

    Try to use the code below instead of yours. Define the code in the functions.php file in your child theme.

    	function woodmart_get_taxonomies_by_query() {
    		$search_string = isset( $_POST['q'] ) ? sanitize_text_field( wp_unslash( $_POST['q'] ) ) : ''; // phpcs:ignore
    		$taxonomy      = isset( $_POST['taxonomy'] ) ? $_POST['taxonomy'] : ''; // phpcs:ignore
    		$results       = array();
    
    		if ( is_array( $taxonomy ) ) {
    			$taxonomy = array_filter(
    				$taxonomy,
    					function( $tax ) {
    						return taxonomy_exists( $tax );
    					}
    				);
    		}
    
    		$args = array(
    			'taxonomy'   => $taxonomy,
    			'hide_empty' => false,
    			'search'     => $search_string,
    		);
    
    		$terms = get_terms( $args );
    
    		if ( is_array( $terms ) && $terms ) {
    			foreach ( $terms as $term ) {
    				if ( is_object( $term ) ) {
    					$results[] = array(
    						'id'   => $term->term_id,
    						'text' => $term->name . ' (' . $term->taxonomy . ')',
    					);
    				}
    			}
    		}
    
    		wp_send_json( $results );
    	}
    
    	add_action( 'wp_ajax_woodmart_get_taxonomies_by_query', 'woodmart_get_taxonomies_by_query' );
    	add_action( 'wp_ajax_nopriv_woodmart_get_taxonomies_by_query', 'woodmart_get_taxonomies_by_query' );

    Regards,

Viewing 5 posts - 1 through 5 (of 5 total)