Forum Archive - gtranslate and woocommerce

gtranslate and woocommerce
Oct 14, 2012 7:27 pm by rashef
Hi guys, I'm using Gtranslate on a Woo-Commerce powered Wordpress. I have a problem: every time I add a new product to the cart the website turn back to English (the language - meaning the "virtual" subfolder - disappear from the URL too). Even if I switch to another language, proceeding with the checkout the website turn back to English at every step of the process. How to avoid that? :(
Re: gtranslate and woocommerce
Oct 17, 2012 7:16 pm by Yana
Hi, Please try to change ajax urls to relative in the /wp-content/plugins/woocommerce/woocommerce.php . This should fix the issue.
Re: gtranslate and woocommerce
Oct 26, 2012 8:47 pm by rashef
Hi Yana, I can't see any absolute path in there. Would you be so kind as to be more specific? I added the file here for ease: http://sdrv.ms/S1RwCx
Re: gtranslate and woocommerce
Oct 28, 2012 9:48 pm by rashef
Any update?
Re: gtranslate and woocommerce
Oct 30, 2012 9:49 pm by rashef
*** PING ***
Re: gtranslate and woocommerce
Oct 31, 2012 2:32 pm by Yana
Hi, Please try to add the following lines in the wp-admin/admin-ajax.php after do_action('admin_init'); line if(isset($_GET['action']) and $_GET['action'] == 'woocommerce-checkout') @header('Content-Type: application/json'); and replace * Ajax URL */ function ajax_url() { $url = admin_url( 'admin-ajax.php' ); $url = ( is_ssl() ) ? $url : str_replace( 'https', 'http', $url ); return $url; } with the following in the /wp-content/plugins/woocommerce/woocommerce.php /** * Ajax URL */ function ajax_url() { $url = admin_url( 'admin-ajax.php' ); $url = ( is_ssl() ) ? $url : str_replace( 'https', 'http', $url ); $url = preg_replace('!http(s)?://' . $_SERVER['SERVER_NAME'] . '/!', '/', $url); return $url; } Hope this will help you.
Re: gtranslate and woocommerce
Oct 31, 2012 7:56 pm by rashef
Hi Yana, I applied the first change. About the second, inside the function ajax_url() I found only this line: return str_replace( array('https:', 'http:'), '', admin_url( 'admin-ajax.php' ) ); I replaced it with yours anyway, but it's still not working: as soon as I click on "Add to chart" the website turns back to english (the subfolder - e.g. /es/ - disappears from the URL).
Re: gtranslate and woocommerce
Oct 31, 2012 8:04 pm by Yana
Hi, If you can send me FTP access info I'll check it.
Re: gtranslate and woocommerce
Oct 31, 2012 8:23 pm by rashef
Thanks! Sent by PM.
Re: gtranslate and woocommerce
Nov 3, 2012 9:07 pm by rashef
Any news?
Re: gtranslate and woocommerce
Nov 5, 2012 10:45 pm by rashef
*** PING ***
Re: gtranslate and woocommerce
Nov 6, 2012 4:19 pm by Yana
Hi, Please check your PM.
Re: gtranslate and woocommerce
Nov 6, 2012 4:35 pm by rashef
Just replied! thanks!!!
Re: gtranslate and woocommerce
Nov 6, 2012 4:43 pm by Yana
Thank you. I'll check it.
Re: gtranslate and woocommerce
Nov 11, 2012 12:13 am by cagerattle
Hello, I am experiencing the same problem. I tried the fix on the first page of the thread, but that did not help. Do you have a fix for this problem?

SIMILAR TOPICS

Gtranslate MultisiteFeb 12, 2019 7:27 amReplies: 1Post by: infact_dat
Gtranslate: Error with numberFeb 20, 2019 1:20 amReplies: 1Post by: infact_dat
GTranslate 3.7.4, Joomla 3.9.3 - doGTranslate is not definedFeb 22, 2019 12:34 pmReplies: 1Post by: oase
Add-on gtranslate no longer worksFeb 2, 2019 6:01 amReplies: 1Post by: DarylDixon
Instragram and Gtranslate...!!!!Dec 19, 2018 11:18 amReplies: 1Post by: zackfernandes

Try GTranslate with a free 15 day trial