I have edited the cart.php file (function event_espresso_cart_link($atts)) so as to check what the current language is (qtrans_getLanguage()) and add the adequate suffix to the redirection url, but when the button is clicked on the starting page in FR, ES or DE, the [espresso_cart_link] shortcode always takes me back to the next page in the default language (EN), whatever the language of the previous page is.
It seems that the [espresso_cart_link] shortcode gets back to default language before the language of the starting page can be stored in the variable declared in event_espresso_cart_link($atts)).
Any idea ?
This topic was modified 11 years, 1 month ago by bmachuel.
The cart.php file is a core file that should not be modified. We can not offer support for core modifications. If you would like to modify the shopping cart, please modify the shopping_cart.php file in the templates directory.
You probably will have to modify the function event_espresso_load_checkout_page, but since it is a pluggable function, you can make a copy of that function in your theme’s functions.php file, the EE custom files add-on custom_functions.php file, or create a separate empty plugin to hold the custom function. That way you are not modifying the core EE files and your modification will not be overwritten the next time you update EE.
Are you using the “direct to cart” mode of the cart link shortcode, or do you get a “view cart” link after you add an item to the cart? I believe you will want to modify the build of the $cart_page_url on line 668.
Viewing 3 reply threads
The support post ‘qtranslate – [espresso_cart_link] takes me back to default language’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.