跳过导航

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.

2 条回复 至 “HUSKY - Products Filter Professional for WooCommerce - Product Category Links Not Correctly Translated”

发表回复

保持话题相关并尊重他人。如果您需要与本帖无关的问题帮助,请使用我们的支持论坛开始聊天或提交工单。

您可以使用这些标签:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>