1

I'm currently using Wordpress with Woocommerce and Polylang installed and set it to two languages. Whenever you switch a language, all of the WooCommerce links sets to the links of a current language (e.g. shop, my account, checkout). Except for the Cart page - it always links to the default (the one that you set as a cart page on the Woocommerce settings) cart page and therefore it is not dynamic. What I've tried is adding this code to the functions.php file:

  function get_woocommerce_cart_polylang()
{
    return pll_get_post(get_option('woocommerce_cart_page_id' ) );
}
add_filter('woocommerce_get_cart_page_id', "get_woocommerce_cart_polylang");

It kinda does the job, but it also breaks the cart page - when refreshing or updating the cart, the page goes blank. Any ideas on how to solve this, or any additions to the code ? Thank you in advance !

Gabrielius
  • 69
  • 1
  • 6
  • [WooCommerce multilingual: Comparing Free and Paid Alternatives](https://wpml.org/home/comparing-wpml-free-paid-alternatives/) – LoicTheAztec Apr 15 '17 at 13:24

0 Answers0