Home › Forums › WoodMart support forum › WOODMART WooCommerce Layered Nav issue in Arabic version
WOODMART WooCommerce Layered Nav issue in Arabic version
- This topic has 16 replies, 2 voices, and was last updated 4 years, 4 months ago by Artem Temos.
-
AuthorPosts
-
July 20, 2020 at 7:35 am #212495
MgabrParticipantDears,
WOODMART WooCommerce Layered Nav filters are not working in Arabic however the slugs are English as you can fin in the attached snapshot.
Please supportAttachments:
You must be logged in to view attached files.July 20, 2020 at 7:55 am #212505
Artem TemosKeymasterHello,
Could you please check how it works with some default WordPress themes like TwentyTwenty or WooCommerce Storefront to understand is it our theme issue or not? You can check WooCommerce attribute filters widgets.
Regards
July 20, 2020 at 8:13 am #212522
MgabrParticipantI tried and both TwentyTwenty or Storefront are working well so it seems to be an issue in your theme
July 20, 2020 at 8:16 am #212523
MgabrParticipantWooCommerce attribute filters widgets is working very well on your theme in all languages and it seems that the issue is in the Layered Nav filters and I need to use it
July 20, 2020 at 8:50 am #212546
Artem TemosKeymasterWe have added both widgets on your shop page (one from our theme and another is from WooCommerce) and they are working identically https://gyazo.com/a37e488a6c05b645172a9b568a06ba1b
July 20, 2020 at 9:01 am #212556
MgabrParticipantPlease try to select any attribute term from Layered Nav filters as it not reflecting any results
July 20, 2020 at 9:02 am #212561
Artem TemosKeymasterYes, we see an empty page. Are we allowed to switch to the default WordPress theme to check it?
July 20, 2020 at 9:15 am #212570
MgabrParticipantYes, sure
July 20, 2020 at 9:17 am #212573
Artem TemosKeymasterHere is what we see (empty page) when trying to visit the same page with other themes https://gyazo.com/b21a77899d1b47bea5eaa315334af49c
July 20, 2020 at 9:21 am #212575
MgabrParticipantCan we arrange for a quick zoom call or something like that where I can share my screen and show you
July 20, 2020 at 9:25 am #212578
MgabrParticipantI activated store front default theme so you can continue troubleshooting, Please re-login now
July 20, 2020 at 9:44 am #212590
Artem TemosKeymasterTry to edit the file
woodmart\inc\widgets\class-widget-layered-nav.php
and replace the functionget_page_base_url
with the following codeprotected function get_page_base_url() { if ( woodmart_is_shop_on_front() ) { $link = home_url(); } elseif ( is_shop() ) { $link = get_permalink( wc_get_page_id( 'shop' ) ); } elseif ( is_product_category() ) { $link = get_term_link( get_query_var( 'product_cat' ), 'product_cat' ); } elseif ( is_product_tag() ) { $link = get_term_link( get_query_var( 'product_tag' ), 'product_tag' ); } else { $queried_object = get_queried_object(); $link = get_term_link( $queried_object->slug, $queried_object->taxonomy ); } // Min/Max. if ( isset( $_GET['min_price'] ) ) { $link = add_query_arg( 'min_price', wc_clean( wp_unslash( $_GET['min_price'] ) ), $link ); } if ( isset( $_GET['max_price'] ) ) { $link = add_query_arg( 'max_price', wc_clean( wp_unslash( $_GET['max_price'] ) ), $link ); } // Order by. if ( isset( $_GET['orderby'] ) ) { $link = add_query_arg( 'orderby', wc_clean( wp_unslash( $_GET['orderby'] ) ), $link ); } /** * Search Arg. * To support quote characters, first they are decoded from " entities, then URL encoded. */ if ( get_search_query() ) { $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link ); } // Post Type Arg if ( isset( $_GET['post_type'] ) ) { $link = add_query_arg( 'post_type', wc_clean( wp_unslash( $_GET['post_type'] ) ), $link ); // Prevent post type and page id when pretty permalinks are disabled. if ( is_shop() ) { $link = remove_query_arg( 'page_id', $link ); } } // Min Rating Arg if ( isset( $_GET['rating_filter'] ) ) { $link = add_query_arg( 'rating_filter', wc_clean( wp_unslash( $_GET['rating_filter'] ) ), $link ); } // All current filters. if ( $_chosen_attributes = WC_Query::get_layered_nav_chosen_attributes() ) { // phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.Found, WordPress.CodeAnalysis.AssignmentInCondition.Found foreach ( $_chosen_attributes as $name => $data ) { $filter_name = wc_attribute_taxonomy_slug( $name ); if ( ! empty( $data['terms'] ) ) { $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link ); } if ( 'or' === $data['query_type'] ) { $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link ); } } } return apply_filters( 'woocommerce_widget_get_current_page_url', $link, $this ); }
July 20, 2020 at 10:43 am #212609
MgabrParticipantThank you
It works very well now however it is very slow compared to store front attributes filters in both English and Arabic versions and compared to the same widget in your demo.Please check and feedback
July 20, 2020 at 10:54 am #212617
MgabrParticipantAlso I just noticed that the terms that are selected can’t deselected when clicked in both Englis and Arabic. Please check
July 20, 2020 at 11:10 am #212625
Artem TemosKeymasterPlease, update the theme to the latest version and check the clear filters button.
July 20, 2020 at 11:26 am #212634
MgabrParticipantI am taking a backup now to update the theme and test the “clear filters button” and will feedback if I faced any issues
What about my other inquiry
“It works very well now however it is very slow compared to store front attributes filters in both English and Arabic versions and compared to the same widget in your demo.”
I think because lazy load is allowed in your demo. Could you please guide how can I do that to reach the same performance as your demo (https://woodmart.xtemos.com/product-category/cooking/?demo=) by changing theme options or editing the theme code
July 20, 2020 at 11:44 am #212641
Artem TemosKeymasterMost likely the performance problem is related to your server and third party plugins. Our demo doesn’t have lazy loading turned on. We use WP Rocket plugin that may increase your website performance too.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register