Home Forums Basel support forum Filters not working correctly on attribute archives

Filters not working correctly on attribute archives

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #27774

    mihael
    Participant

    Hello,

    I noticed that when I visit the “attribute archive” for “brand”, under the “Filters” there’s other Brands available, but the logic doesn’t work and it tries to filter out other brands’ products while displaying certain brand… The result is “Products not found” which is very misleading.

    To reproduce, visit the link, click “Filters” and then select something under “Znamke” (ang. Brands).

    Please advise how to resolve this. Thank you

    #27775

    mihael
    Participant

    I forgot to mark “Notify…” so I’m making this comment so that I can subscribe to replies.

    #27784

    mihael
    Participant

    I see that his is “being forced” in woocommerce.php line 1384?

    /**
     * ------------------------------------------------------------------------------------------------
     * Force BASEL Swatche layered nav and price widget to work
     * ------------------------------------------------------------------------------------------------
     */
    
    //add_filter( 'woocommerce_is_layered_nav_active', '__return_true' );
    add_filter( 'woocommerce_is_layered_nav_active', 'basel_is_layered_nav_active' );
    if( ! function_exists( 'basel_is_layered_nav_active' ) ) {
    	function basel_is_layered_nav_active() {
    		return is_active_widget( false, false, 'basel-woocommerce-layered-nav', true );
    	}
    }
    
    add_filter( 'woocommerce_is_price_filter_active', 'basel_is_layered_price_active' );
    
    if( ! function_exists( 'basel_is_layered_price_active' ) ) {
    	function basel_is_layered_price_active() {
    		$result = is_active_widget( false, false, 'basel-price-filter', true );
    		if( ! $result ) {
    			$result = apply_filters( 'basel_use_custom_price_widget', true );
    		}
    		return $result;
    	}
    }
    #27787

    mihael
    Participant

    Also, what are those functions for? It seems that everything works great without it.

    #27803

    Artem Temos
    Keymaster

    Hi,

    The point is that your menu brands links have a format like this /znamka/made-in-italia/ and when you on that page click on some brand in the filter the link becomes this /znamka/made-in-italia/?filter_znamka=blu-byblos. So it looks for another brand on the page that already has only one brand. To fix this you need to change your mega menu links to those that compatible with filters links. For example /znamka/made-in-italia/ should be /trgovina/?filter_znamka=made-in-italia&query_type_znamka=or

    Those PHP functions check if widgets are already added via Appearance -> Widgets. If not, then our theme default widgets will be shown.

    Regads

    #27808

    mihael
    Participant

    I want to show “brand” archive.
    In sidebar, the widgets work as they are supposed to while in “shop filters” the same widgets don’t function properly. The “brands” is shown despite the fact that the products shown do not have these attributes.
    So, the point is actually that there is something wrong and I shouldn’t be forced to display page one way or another…

    So, the issue is obvious and I want to show the attribute “brand” archive with properly functioning filters.

    What to do now? Please note that I NEED brand attribute archive, as just calling the main category and filter out the brands is not a solution to present the products by certain brand. For example, how can I add the brand description on those pages…? Etc.

    Please come up with the solution to make the filters work properly in the “Filters” section.

    #27809

    mihael
    Participant

    Don’t bother with this anymore… I fixed it myself.

    #27824

    Artem Temos
    Keymaster

    OK, by the way, could you please write what solution did you choose for this problem?

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