Home / Forums / WoodMart support forum / Managing Brand Filters for Specific Categories in woodmart
Home › Forums › WoodMart support forum › Managing Brand Filters for Specific Categories in woodmart
Managing Brand Filters for Specific Categories in woodmart
- This topic has 13 replies, 2 voices, and was last updated 2 years, 1 month ago by
Artem Temos.
-
AuthorPosts
-
June 29, 2024 at 12:29 pm #576408
av_admin_1984ParticipantHi
I want to know what is different between these url’s?https://woodmart.xtemos.com/shop/?filter_brand=alessi?filter_brand=apple https://woodmart.xtemos.com/product-category/furniture/?filter_brand=alessi https://woodmart.xtemos.com/product-category/accessories/?filter_brand=alessiI used Layouts in wordpress backend created a page for the filter, and added to the condition to show
1-filter brand for Apple
2-only apply to mobile phones not all the filter pages!
now it shows on all the site pages,
I want to separate the phone category plus brand filter just for Apple, not the entire sitewhat should I do?
July 1, 2024 at 10:00 am #576602Hello,
Please send us a link to the page where you want to apply your custom layout and your admin access so we can check the configuration.
Kind Regards
July 1, 2024 at 12:54 pm #576715
av_admin_1984ParticipantHi
1-Please don’t share anything about my site in public. if you are faced with an error or whatever, just create a video or image put it on WordPress gallery, and let me know to check it
2-This is the real site, not staging, please don’t disable any plugin
3-With those URLs in the private box you will see what I mean and what I’m looking for, so if it’s not working on this site for any reason, please give me a clear solution so I can fix that
4- Just create the layout for those 3 URLs with different colors and let me know to check and complete the setup
Thank you so much.
July 2, 2024 at 10:52 am #576974It is not possible to apply a layout to particular categories filtered by particular brands. In this case, try to add the following code to the
functions.phpfile in the child theme.add_action( 'woodmart_layout_id', function ( $layout_id ) { if ( ! is_shop() && ! is_product_category() && ! is_product_tag() && ! woodmart_is_product_attribute_archive() ) { return $layout_id; } $type = 'shop_archive'; $conditions_data = get_option( 'wd_layouts_conditions' ); $current_conditions_data = isset( $conditions_data[ $type ] ) ? $conditions_data[ $type ] : array(); if ( ! isset( $current_conditions_data[ $layout_id ] ) || 2 < count( $current_conditions_data[ $layout_id ] ) ) { return $layout_id; } $is_filtered = false; $sorted_data = array(); $conditions_priority = array(); foreach ( $current_conditions_data[ $layout_id ] as $key => $condition ) { if ( 0 <= strpos( $condition['condition_type'], 'filtered' ) ) { $is_filtered = true; break; } } if ( ! $is_filtered ) { return $layout_id; } foreach ( $current_conditions_data as $post_id => $conditions ) { $post_id = apply_filters( 'wpml_object_id', $post_id, 'woodmart_layout' ); $post = get_post( $post_id ); $is_active_prev_condition = false; $has_filtered_condition = false; foreach ( $conditions as $key => $condition ) { $is_active = XTS\Modules\Layouts\Shop_Archive::get_instance()->check( $condition ); if ( $has_filtered_condition && ! $is_active_prev_condition && $is_active ) { unset( $sorted_data[ $post_id ] ); break; } if ( 0 <= strpos( $condition['condition_type'], 'filtered' ) ) { if ( ! $is_active ) { unset( $sorted_data[ $post_id ] ); break; } $has_filtered_condition = true; } if ( $is_active && $post && 'publish' === $post->post_status ) { $is_active_prev_condition = true; $sorted_data[ $post_id ][ $condition['condition_comparison'] ][] = array( 'is_active' => $is_active, 'priority' => wd_get_condition_priority( $condition['condition_type'] ), ); } } } foreach ( $sorted_data as $post_id => $conditions ) { if ( isset( $conditions['include'] ) ) { foreach ( $conditions['include'] as $condition ) { if ( $condition['is_active'] ) { $conditions_priority[ $post_id ] = $condition['priority']; } } } if ( isset( $conditions['exclude'] ) ) { foreach ( $conditions['exclude'] as $condition ) { if ( $condition['is_active'] ) { unset( $conditions_priority[ $post_id ] ); } } } } asort( $conditions_priority ); $conditions_priority = array_flip( $conditions_priority ); return end( $conditions_priority ); }); function wd_get_condition_priority( $type ) { $priority = 100; switch ( $type ) { case 'all': $priority = 10; break; case 'shop_page': $priority = 20; break; case 'product_cats': case 'product_tags': case 'product_attr': $priority = 30; break; case 'product_cat_children': $priority = 40; break; case 'product_search': $priority = 50; break; case 'product_cat': case 'product_tag': case 'product_attr_term': case 'product_term': $priority = 70; break; case 'filtered_product_term': case 'filtered_product_by_term': case 'filtered_product_term_any': case 'filtered_product_stock_status': $priority = 80; break; case 'product': $priority = 90; break; } return apply_filters( 'woodmart_layouts_condition_priority', $priority, $type ); }Kind Regards
-
This reply was modified 2 years, 1 month ago by
Artem Temos.
July 3, 2024 at 6:41 pm #580740
av_admin_1984ParticipantHi
I tested it in localhost and it workedare you going to add this for the next update to the theme?
is that working for the new version of woocommerce in the future?Thank you so much
July 4, 2024 at 9:17 am #580855Hello,
We would kindly ask you to test it on your website for some time. If it works without any problems, we will make these changes to our theme.
Kind Regards
July 4, 2024 at 2:30 pm #580928
av_admin_1984ParticipantHello,
Yes, sure, with Plusher I’m using it on our site and next month I will give you a report on that.
July 4, 2024 at 4:34 pm #580995Excellent, thank you very much. We will keep this topic open for now.
July 9, 2024 at 5:10 pm #582178
av_admin_1984ParticipantHello
According to this topic and the URLs we discussed before
https://woodmart.xtemos.com/shop/?filter_brand=alessi?filter_brand=apple https://woodmart.xtemos.com/product-category/furniture/?filter_brand=alessi https://woodmart.xtemos.com/product-category/accessories/?filter_brand=alessiin a single product, we have a brand icon that shows the shop/?filter_brand
for example this address:https://woodmart.xtemos.com/shop/furniture/panton-%d0%beunior-chair/
is it possible to edit something that each brand refers to their categories?for example, if I’m here:
https://woodmart.xtemos.com/accessories/product/full-aquarelle-iphone-xr/
and when I click on the Anker brand Icon, it opens this addresshttps://woodmart.xtemos.com/accessories/product-category/cases/vs the shop addressis it possible?
July 10, 2024 at 9:27 am #582276Hello,
It’s not possible to customize brand links in the theme to have them refer to specific categories. The brand icon links will always direct users to the shop page filtered by the brand.
July 10, 2024 at 10:26 am #582309
av_admin_1984ParticipantHello Artem Temos
How are you?
thank you for reply
is it possible to have template for each brand of each category and add the brand logo with url look like this?
https://woodmart.xtemos.com/accessories/product/full-aquarelle-iphone-xr/I mean, I want to have brand logo manually in important category and brand,
is it possible?how can I have this demo?
https://woodmart.xtemos.com/marketplace2/thanks
July 10, 2024 at 2:11 pm #582396Hello,
Unfortunately, there is no brand logo element for the archive layout.
As for the Marketplace 2 demo, it is under development and has not yet been released. It will be available soon.
Kind Regards
July 16, 2024 at 12:32 pm #583652
av_admin_1984ParticipantHello
You mean there is no way to change the filter brand Icon behavior with code?
July 16, 2024 at 3:05 pm #583700Hello,
We don’t have a custom code for such a customization, sorry.
Kind Regards
-
This reply was modified 2 years, 1 month ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register