Skip Navigation

Open

Reported for: WooCommerce Multilingual & Multicurrency 5.3.7

Topic Tags: Compatibility, WCML

Overview of the issue

When using HUSKY – Products Filter Professional for WooCommerce with WPML, there is a known issue where product category links like the following are not correctly translated.

For example, translating http://www.domain.com/product-category/slug1/slug2/slug3, results into http://www.domain.com/?product_cat=slug3, instead of having: http://www.domain.com/en/product-category/slug1/slug2/slug3.
This issue results in URLs that do not resolve correctly in secondary languages, leading to 404 errors.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Add the following code to the theme’s functions.php file:
    // WPML Workaround for compsupp-7532
    function wpml_compsupp7532_add_custom_blacklist_requests( $blacklist, $sitepress ) {    
    	// Add your custom request to the blacklist array
    
      // We can hardcode URL's, like:
      // Add here your problematic URL's
      $blacklist[] = "category-product/slug1/slug2/slug3";
        
      return $blacklist;
    }
    
    add_filter( 'wpml_sl_blacklist_requests', 'wpml_compsupp7532_add_custom_blacklist_requests', 10, 2 );
    
  • Add a small modification to the block content.
  • You may need to re-translate the links.

Leave a Reply

Please stay on topic and be respectful to others. If you need help with issues not related to this post, use our Support Forum to start a chat or submit a ticket.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>