Woocommerce & Polylang: shop page in proper language

I combined Woocommerce & Polylang to make multilingual shop.

The problem appeared, while I tried to display Shop page in other language than main one.

I solved the problem in the following way:

Add the code to your theme function.php file.

This function actually gets set Shop page id and converts to the current language version.