PolyLang with Woocommerce - default cart page is not translating - wordpress

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 !

Related

Stay on shop page when add to cart

I'm using elementor pro, woocommerce, ocean wp theme and the elementor custom skin add-on.
I want to build an ecommerce website without products pages but only a shop page, in order to have all my products on the shop page with add to cart button and a quantity selector.
For that, I used the loop system and it works quite well.
I only have 1 issue : when you add a product to the cart, it automaticaly redirects you to the product page.
I don't want to use the products pages. I would like to disable them.
I want customers to stay on the shop page for further shopping. Only access to cart page or checkout page when they click on the add to cart menu.
If it's possible to do that without coding it's best, otherwise, please tell me how to do if you can :)
thank you!
This issue can be fixed if you click on the tick mark named as " Redirect to the cart page after successful addition". You will find it in Woocommerce > Settings > General.
This will help customers to go to the cart page after they add something to the cart. But I don't know how to redirect customers to the shop page after they add to cart something. I am also asking for that help.
See the screenshot:

Woocommerce Add To Cart redirect to Checkout not working

I'm trying to redirect people who click on the add to cart button to the checkout page directly. The add to cart button only is adding the product to cart but not redirecting at all.
I've tried to put the WooCommerce setting on auto
https://gyazo.com/d5357f81ccb48723ea72125a3368dd81
I'm using the Theme Sartre on my website but another website with the same theme is working well so i'm confused.
The only bit of code i've added is https://gyazo.com/6d13ed2ebc037b8576dcb911a1328241 in the function.php file of my theme.
My website doesn't seem to show any error while i'm pressing Add to Cart
https://chase-lab.com/
I'm using the latest version of woocommerce Version 3.6.1
Thanks for your help

woocommerce cart not working with custom WP theme

I have a custom wp theme. WooCommerce is installed and up to date. Product pages work, and "add to cart works" however, on the cart page, the shipping calculator simply reloads the page, and changing shipping options that do appear does not update the cart total. tried a default wp theme to test and it works fine there. Any ideas? I used the theme integration guide method of using the woocommerce_content tag and created woocommerce.php. No luck

Display Products for Woocommerce

I created a Wordpress page that must display the products that I've created using Woocommerce Plugin. It seems like it has it's own Shop Page so I tried to customize it (it has different template) but failed since I am just a beginner in Wordpress. So I tried making my own Wordpress page (just like what I said at the first line) having the same template with other menu options. So it's good. The problem is I cannot make the products show. So I searched and installed a Display Product for Woocommerce Plugin so that I can call the products, on the webpage that I created, using shortcodes. Unfortunately, there is no single products that shows in my page. Any suggestions with this?
Try using this Shortcode [products] on a new page. It showed me all the products i had in my woocommerce store.
Let me know if that fulfills your needs.

pagination not displayed in woocommerce plugin in wordpress

Navigation arrow keys for pagination are not displayed in products page. I have used woocommerce plugin in wordpress 3.4.2 version.
They will not be visible till you have enough products to have 2 or more pages.
Can't remember why this happens. I think its because wordpress posts per page is set to 'n' in your settings so woocommerce follows that setup (only showing 'n' number of products)
Anyway to fix it open your functions.php file and insert:
add_filter('loop_shop_per_page', create_function('$cols', 'return 4;'));

Resources