Please make sure to update to WPML 4.3.5 and check our list of Known Issues before reporting

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 7 replies, has 3 voices.

Last updated by mehmetc-2 3 years ago.

Assigned support staff: Bernat Torras.

Author Posts
November 21, 2016 at 12:09 pm #1140597

andreaC-50

I am trying to:
Connect the WooCommerce iOS App (hidden link) to my test website that has a WooCommerce Shop

URL of (my) website where problem appears:
hidden link

I expected to see:
Connect the App to the Website

Instead, I got:
An error saying: "Setup failure: an error occured during setup for this shop"

Steps to duplicate the issue:
- Install WordPress
- Install WPML and set the Language URL format to "Different languages in directories"
- Install WooCommerce and configure it like described in this paper: https://docs.woocommerce.com/document/woocommerce-ios/#connecting-app
- Install the WooCommerce iOS App in a iPhone
- Try connect the app to the website.
----------------------------------------

The WooCommerce documentation says that there is a known conflict between WPML and WooCommerce REST API.
They suggest a workaround but I want to keep my code standard, without any personal patch.

Just wanted to know if there is any plan to solve this issue

Thanks
Andrea

November 22, 2016 at 9:30 am #1141380

Bernat Torras

Hi @andreac-50,

Thanks for contacting support, I'll do my best to help you with this! 🙂

WooCommerce Multilingual development team is aware of the incompatibilities with WooCommerce REST API and they're actively working on it to make our plugins 100% compatible with it. The problem was that it seems that it suddenly changed and we're now refactoring all our compatibility class to make sure it is using the new standards.

In any case, could you please try the suggested workaround described in WooCommerce documentation to check if it fixes the issue? If not, let us know and I'll report it to our development team to make sure we don't miss any issue.

We'll be waiting for your feedback!

Thanks,
Bernat

November 23, 2016 at 8:17 am #1142241

andreaC-50

Hi Bernat,
thank you for the quick reply.

I don't know how to try the workaround 2 suggested by the WooCommerce troubleshooting page
https://docs.woocommerce.com/document/ios-app-troubleshooting-connection-store/
I think you need basic WordPress coding skills to do it and I'm not a programmer.

I tried the workaround 1 changing the [Language URL format] setting to [Language name added as a parameter] but still the iOS app cannot connect the website (same error as before)
But to do a real test I think I should do it on a clean WordPress install, with a basic theme and only WPML and WooCommerce, without other plugins. I cannot add a test website on my server now but I hope to be able to do it soon.

Ciao
Andrea

November 23, 2016 at 11:30 am #1142433

Bernat Torras

Hi Andrea,

I think that the workaround suggested on WooCommerce documentation requires both steps (not just one of them). It should be pretty easy to apply #2, you just need to edit this file "hidden link" and add this code at the bottom:

function wpml_wc_api_home_url( $url, $path, $orig_scheme, $blog_id ) {
    global $sitepress;

    if ( isset( $sitepress ) && 0 === strpos( $path, 'wc-api/' ) ) {

        $url = $sitepress->convert_url( str_replace( $path, '', $url ), $sitepress->get_default_language() );
        $url = untrailingslashit( $url ) . '/' . ltrim( $path, '/' );
    }

    return $url;
}
add_filter( 'home_url', 'wpml_wc_api_home_url', 0, 4 );

Can you try it and check if it works?

Thanks,
Bernat

November 23, 2016 at 12:43 pm #1142505

andreaC-50

Hi Bernat
thank you for you help and time.

I committed the patch in function.php, restarted Apache and purged all caches (we use W3 Total Cache) but the iOS app cannot connect to the website.

I can see dialog between the app and the website from the WooCommerce -> Settings -> API -> Keys/Apps because the last access time to the key created for that connection is just the time I press the [Complete setup] button on the iPhone.

May be is not a problem of WPML. Maybe there is something else going on.

I leave the thread open because is not resolved but if you want you can close it.
I was just testing a WooCommerce feature and I came here because WooCommerce declared a WPML problem.

I will take a deeper look when I will be able to create another clean wordpress install open to the internet. I will test the connection between the iOS app and the website with WooCommerce as the only plugin installed. Then I will add WPML and check if it really breaks the connection.
But I'm available for you to try some workaround simple and easy like the one you suggested me before.

Ciao
Andrea

November 23, 2016 at 1:17 pm #1142553

Bernat Torras

Hi Andrea,

Thanks for your feedback. Ok, I agree that the best would be to check first if you're able to get it working on a fresh install without any other plugins installed. Then, as you say, enable WPML and check if the issue reappear. If so, let us know and we'll take a deeper look at it to check if we can fix it while we're fixing the WC REST API compatibility (if its not part of the issues we're already working on).

I'll close the ticket by now. Please let us know your results as soon as possible. If the problem is really related to WPML we'll re-open the thread and continue working from where we left it.

We'll be waiting for your results. 🙂

Thanks,
Bernat

December 13, 2017 at 1:20 pm #1456741

mehmetc-2

Hello, I'm having the same issue. is this issue has already resolved? if not what is the "hidden link" to be edited for the additional function?

December 13, 2017 at 2:38 pm #1456863

mehmetc-2

Hi again, it seems cloudflare is what causing the trouble. I managed to solve through hosting settings.