Support

Home Forums Event Espresso Premium qtranslate – [espresso_cart_link] takes me back to default language

qtranslate – [espresso_cart_link] takes me back to default language

Posted: October 16, 2013 at 6:18 am

Viewing 3 reply threads


bmachuel

October 16, 2013 at 6:18 am

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.


Jonathan Wilson

October 16, 2013 at 11:57 am

Hi there,

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.


bmachuel

October 16, 2013 at 12:59 pm

Hi Jonathan,

Thanks for your prompt reply.
Please forget about my tweaks in cart.php.

How can I prevent the [espresso_cart_link] shortcode from redirecting me to the default language?

Thanks in advance.

Benoit Machuel


Sidney Harrell

October 23, 2013 at 10:55 am

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.

Event Espresso