Home › Forums › Basel support forum › Filters not working correctly on attribute archives
Filters not working correctly on attribute archives
- This topic has 7 replies, 2 voices, and was last updated 7 years ago by Artem Temos.
-
AuthorPosts
-
December 7, 2017 at 5:05 pm #27774
mihaelParticipantHello,
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
December 7, 2017 at 5:06 pm #27775
mihaelParticipantI forgot to mark “Notify…” so I’m making this comment so that I can subscribe to replies.
December 7, 2017 at 6:04 pm #27784
mihaelParticipantI 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; } }
December 7, 2017 at 6:13 pm #27787
mihaelParticipantAlso, what are those functions for? It seems that everything works great without it.
December 7, 2017 at 6:56 pm #27803
Artem TemosKeymasterHi,
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
December 7, 2017 at 7:29 pm #27808
mihaelParticipantI 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.
December 7, 2017 at 8:00 pm #27809
mihaelParticipantDon’t bother with this anymore… I fixed it myself.
December 8, 2017 at 7:08 am #27824
Artem TemosKeymasterOK, by the way, could you please write what solution did you choose for this problem?
-
AuthorPosts
- You must be logged in to create new topics. Login / Register