Home Forums WoodMart support forum WOODMART WooCommerce Layered Nav issue in Arabic version

WOODMART WooCommerce Layered Nav issue in Arabic version

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #212495

    Mgabr
    Participant

    Dears,
    WOODMART WooCommerce Layered Nav filters are not working in Arabic however the slugs are English as you can fin in the attached snapshot.
    Please support

    Attachments:
    You must be logged in to view attached files.
    #212505

    Artem Temos
    Keymaster

    Hello,

    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

    #212522

    Mgabr
    Participant

    I tried and both TwentyTwenty or Storefront are working well so it seems to be an issue in your theme

    #212523

    Mgabr
    Participant

    WooCommerce 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

    #212546

    Artem Temos
    Keymaster

    We 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

    #212556

    Mgabr
    Participant

    Please try to select any attribute term from Layered Nav filters as it not reflecting any results

    #212561

    Artem Temos
    Keymaster

    Yes, we see an empty page. Are we allowed to switch to the default WordPress theme to check it?

    #212570

    Mgabr
    Participant

    Yes, sure

    #212573

    Artem Temos
    Keymaster

    Here is what we see (empty page) when trying to visit the same page with other themes https://gyazo.com/b21a77899d1b47bea5eaa315334af49c

    #212575

    Mgabr
    Participant

    Can we arrange for a quick zoom call or something like that where I can share my screen and show you

    #212578

    Mgabr
    Participant

    I activated store front default theme so you can continue troubleshooting, Please re-login now

    #212590

    Artem Temos
    Keymaster

    Try to edit the file woodmart\inc\widgets\class-widget-layered-nav.php and replace the function get_page_base_url with the following code

    protected 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 );
    		}
    #212609

    Mgabr
    Participant

    Thank 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

    #212617

    Mgabr
    Participant

    Also I just noticed that the terms that are selected can’t deselected when clicked in both Englis and Arabic. Please check

    #212625

    Artem Temos
    Keymaster

    Please, update the theme to the latest version and check the clear filters button.

    #212634

    Mgabr
    Participant

    I 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

    #212641

    Artem Temos
    Keymaster

    Most 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.

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