• Resolved essenmitsosse

    (@essenmitsosse)


    I already posted this in the WPML Forums, but I am not sure which side is causing the problem.

    I’ve got a site set up in German and English and everything is working fine except the checkout process.

    I am using the following plugins:
    WPML Multilingual CMS — 2.9.1
    WPML String Translation — 1.8.1
    WPML Translation Management — 1.7.1
    WooCommerce — 2.0.13
    WooCommerce Multilingual — 2.3.2

    and WordPress Version 3.6

    For testing purposes I am using the Twenty Thirteen Theme, but changing it doesn’t make a difference.

    Site can be found here: thobeck.de/wordpress

    Actually I want to use different domains for each language (thobeck.de / thobeck.com), which is working fine, but on the checkout page for the English Version (German being the default language), it produces the forever spinning and loading „Your Order“ Area, which has been described by some other users in the Forum.

    Javascript console throws this error:

    XMLHttpRequest cannot load http://thobeck.de/wordpress/wp-admin/admin-ajax.php?lang=en. Origin http://thobeck.com is not allowed by Access-Control-Allow-Origin.

    So problem seems to be, that the AJAX is trying to access the .de Domain, even though we are on the .com Domain.

    I can avoid the forever loading by adding

    Header add Access-Control-Allow-Origin: "*"

    to the .htaccess file, which allows the AJAX to get to the .de Version of the site, but there the basket is empty and I get „Sorry, your session has expired.“ So this is not really solving the issue.

    Woocommerce is getting the url for AJAX in woocommerce-multilingual/woocommerce_wpml.class.php
    line 658:

    $value['ajax_url'] = admin_url('admin-ajax.php?lang=' . ICL_LANGUAGE_CODE);

    admin_url() is returning the default address, if it would return the current address the problem should be solved (tried it by hardcoding the .com Domain in there, instead of the function)

    $value['ajax_url'] = 'http://thobeck.com/wordpress/wp-admin/admin-ajax.php';

    For now I can solve this issue, by putting the different languages in different directories on the same server. But this leads to another problem: Now everything after the „Your Order“ Area on the check-out page will be in English, even though I ordered from the German site. This includes the confirmation for successfully submitting an Order and all the emails that are send to the admin and to the user.

    The second issue still persist, even when I fix the first one by hardcoding the .com domain. Strange thing is, the German Server is than able to make a call to the .com one. Swapping the default languages just swaps the problem.

    I hope you can help me quickly with this. Looks like something, that needs a bug-fix. If you need any more information let me know.

    If I stop the javascript from reloading the Order Review area, everything works like a charm. So that part obviously is causing all the trouble. But since this is necessary to recalculate the shipping costs, I cant’t just get rid of it.

    http://wordpress.org/plugins/woocommerce-multilingual/

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Check-out Problems’ is closed to new replies.