gtranslate and woocommerce

Popular automatic website translation tool

gtranslate and woocommerce

Postby rashef » Sun Oct 14, 2012 11:27 pm

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? :(
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby Yana » Wed Oct 17, 2012 11:16 pm

Hi,
Please try to change ajax urls to relative in the /wp-content/plugins/woocommerce/woocommerce.php .
This should fix the issue.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: gtranslate and woocommerce

Postby rashef » Sat Oct 27, 2012 12:47 am

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
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby rashef » Mon Oct 29, 2012 1:48 am

Any update?
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby rashef » Wed Oct 31, 2012 1:49 am

*** PING ***
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby Yana » Wed Oct 31, 2012 6:32 pm

Hi,
Please try to add the following lines in the wp-admin/admin-ajax.php after do_action('admin_init'); line
Code: Select all

if(isset($_GET['action']) and $_GET['action'] == 'woocommerce-checkout')
   @header('Content-Type: application/json');


and replace
Code: Select all

    * 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
Code: Select all
    /**
     * 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.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: gtranslate and woocommerce

Postby rashef » Wed Oct 31, 2012 11:56 pm

Hi Yana, I applied the first change. About the second, inside the function ajax_url() I found only this line:
Code: Select all
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).
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby Yana » Thu Nov 01, 2012 12:04 am

Hi,
If you can send me FTP access info I'll check it.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: gtranslate and woocommerce

Postby rashef » Thu Nov 01, 2012 12:23 am

Thanks!
Sent by PM.
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby rashef » Sun Nov 04, 2012 1:07 am

Any news?
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby rashef » Tue Nov 06, 2012 2:45 am

*** PING ***
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby Yana » Tue Nov 06, 2012 8:19 pm

Hi,
Please check your PM.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: gtranslate and woocommerce

Postby rashef » Tue Nov 06, 2012 8:35 pm

Just replied! thanks!!!
rashef
 
Posts: 12
Joined: Sun Sep 16, 2012 12:22 pm

Re: gtranslate and woocommerce

Postby Yana » Tue Nov 06, 2012 8:43 pm

Thank you. I'll check it.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4135
Joined: Thu Jan 12, 2012 6:21 pm

Re: gtranslate and woocommerce

Postby cagerattle » Sun Nov 11, 2012 4:13 am

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?
cagerattle
 
Posts: 7
Joined: Sun Nov 11, 2012 4:09 am


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux