This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 15 posts - 541 through 555 (of 18,415 total)
  • Author
    Posts
  • in reply to: Filtering #55686
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Search returns Status: 500 #55685
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Unable to show predicative search #55681
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thank you for the details, it helped a lot.

    The issue was caused by a custom code snippet in your theme functions.php file, which was used to exclude out of stock items, however it was not working correctly. I have deactivated that, and instead I have added an out of stock filter to make it work properly without any custom code.

    in reply to: Search returns Status: 500 #55678
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Results ordering not working #55673
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Geoff,

    Thank you very much! I was able to identify the issue, it was actually a yet unknown bug due to a wrong option check. I have corrected a single line of code within Ajax Search Pro to resolve this issue, now it should work fine.

    Please make sure to copy the ajax-search-pro plugin directory from staging back to the production so the change is propagated.

    I will make sure this issue is permanently resolved within the upcoming version.

    in reply to: Elementor WooCommerce hide empty product filters #55671
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Great! Thank you very much for the feedback, I will make sure to integrate this to the upcoming release 🙂

    in reply to: Elementor WooCommerce hide empty product filters #55669
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Paul,

    This might get a bit tricky, but it is likely possible to some extent via custom code. I have an experimental solution, which hooks into the filters and tries to restrict them to the current possible archive result set.

    This is an extract from a possible feature in the upcoming version, but it should do the trick to some extent. Instructions below, but let me know if you need help with it:

    function get_available_taxonomy_terms( $taxonomy ) {
    	global $wpdb;
    
    	// Initialize terms array
    	$terms = [];
    	$cache_key = 'terms_' . $taxonomy;
    
    	// Get the current queried object
    	$current_queried_object = get_queried_object();
    
    	// Check if we're on a term archive
    	if ( is_a( $current_queried_object, 'WP_Term' ) ) {
    		// Update cache key to include the term ID
    		$cache_key .= '_' . $current_queried_object->term_id;
    
    		// Check transient cache
    		$cached_terms = get_transient( $cache_key );
    		if ( false !== $cached_terms ) {
    			return $cached_terms;
    		}
    
    		// Get post IDs in the current category using a custom SQL query
    		$query = $wpdb->prepare(
    				"
                SELECT DISTINCT tr.object_id
                FROM {$wpdb->term_relationships} tr
                INNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
                WHERE tt.taxonomy = %s
                AND tt.term_id = %d
                ",
    				$current_queried_object->taxonomy, // e.g., 'category'
    				$current_queried_object->term_id
    		);
    
    		$post_ids = $wpdb->get_col( $query );
    
    		if ( empty( $post_ids ) ) {
    			return []; // No posts in this category, return empty array
    		}
    
    		// Use get_terms() to get terms associated with these post IDs
    		$terms = get_terms( [
    				'taxonomy'   => $taxonomy,
    				'hide_empty' => false, // Include terms even if empty in other contexts
    				'object_ids' => $post_ids, // Filter by post IDs
    				'fields'     => 'all',
    		] );
    
    		if ( is_wp_error( $terms ) ) {
    			$terms = [];
    		}
    	} else {
    		// Not a term archive, fall back to all terms for the taxonomy
    		$cached_terms = get_transient( $cache_key );
    		if ( false !== $cached_terms ) {
    			return $cached_terms;
    		}
    
    		// Get all terms for the taxonomy
    		$terms = get_terms( [
    				'taxonomy'   => $taxonomy,
    				'hide_empty' => true, // Only include terms with associated posts
    				'fields'     => 'all',
    		] );
    
    		if ( is_wp_error( $terms ) ) {
    			$terms = [];
    		}
    	}
    
    	// Cache the results for 1 hour
    	set_transient( $cache_key, $terms, HOUR_IN_SECONDS );
    
    	return $terms;
    }
    
    add_filter('asp_fontend_get_taxonomy_terms', function( $terms, $taxonomy, $args, $needed_all ){
    	return get_available_taxonomy_terms($taxonomy);
    }, 10, 4);

    Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    in reply to: Order by ACF field with GenerateBlocks Query block #55667
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Order by ACF field with GenerateBlocks Query block #55665
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Full height for Checkboxes (Filter) #55662
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Nice work!

    Unfortunately automated unchecking of parent checkboxes is not possible at the moment. I usually recommend a custom code snippet where I can, but this might be a bit more complex as not only the checkbox but the state has to be updated so it’s not sent as “checked” to the back-end.

    It shouldn’t be too hard to implement though in the code, I will take this as a feature request, I will try to add an option to the back-end to enable this behavior in the upcoming version.

    in reply to: Plugin Version #55659
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: Full height for Checkboxes (Filter) #55654
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Great!

    It is actually possible, here: https://i.imgur.com/rkydVFs.png
    Then use the search shortcode as normal: [wpdreams_asp_settings id=1]

    in reply to: Filtering #55652
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    in reply to: issue Avada Theme #55650
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Thanks for the details!

    I tried it by clicking on the “Bewerk Live” button, it seems to work all right on my end, I’m getting this editor which seems to be the homepage: https://i.imgur.com/ILIYiqb.png

    in reply to: Order by ACF field with GenerateBlocks Query block #55649
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 15 posts - 541 through 555 (of 18,415 total)