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 10 replies, has 3 voices.

Last updated by tomasP-10 11 months, 3 weeks ago.

Assigned support staff: Sumit.

Author Posts
September 27, 2018 at 4:03 pm

tomasP-10

Hello,

I am re-opening the "resolved" thread "WooCommerce Subscription renewal order created under staging site lock when WPML is active.".

Please send this again to 2nd tier support. The problem still remains. It looks that new orders have not been created under staging site, but all renewals that was proceeding this week are staging. Had to disable WPML again to make it work.

I really need to resolve it ASAP, we cannot expand because we have no language mutations. We have another 20 days to make it work.

Sincerely,
Tomáš Pokorný

September 28, 2018 at 8:41 pm #2774845

Ricardo Alday

Hi,

This has been escalated to our 2nd tier support for review.

October 1, 2018 at 7:11 am #2777225

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Tomáš,

Could you please let me know the order numbers having this issue?

Thanks

October 7, 2018 at 5:42 pm #2794066

tomasP-10

Hello,

pardon for not getting back sooner.

Actually I have no such orders. I deleted them all and re-set the subscriptions renewal with WPML deactivated, so all my renewal orders could proceed. We have renewals every month from 25th to 31th.

I was looking into options -> siteurl, home, wc_subscriptions_siteurl are all the same with WPML deactivated or activated. There is no wcs_ignore_duplicate_siteurl_notice at all, when WPML activated or deactivated.

Could it be a problem with htaccess? I have a basic setup, but lot of records from caching and security plugins. Would love to try it when they are deactivated. Have no other idea. Should I test it and get back to you? Do you have any other ideas?

Sincerely,

October 8, 2018 at 7:11 am #2794874

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi Tomáš,

In this case, I will advise you to place a debugging code in the core of WP Subscription plugin so I can see what is going on.

Please go to line \plugins\woocommerce-subscriptions\woocommerce-subscriptions.php line 1164 inside the function is_duplicate_site()
and place the below code just before this line

return apply_filters( 'woocommerce_subscriptions_is_duplicate_site', $is_duplicate );

Code

$error_data = array();
$error_data['site_url'] = $site_url;
$error_data['wcs_site_url'] = self::get_site_url();
$error_data['wcs_site_url_parts'] = $wcs_site_url_parts;
$error_data['is_duplicate'] = $is_duplicate;
$error_data['global'] = $_SERVER;
error_log(json_encode($error_data));

This will create an error log when this duplicate function is called so we can see what are the URLs and parameter on that time causing this issue.
Please clear the error log before making these changes.

Please let me know if this is possible for you to do?

Thanks

October 11, 2018 at 4:44 pm #2809158

tomasP-10

Hello,

I did exactly what you wanted, but I am not able to reproduce the problem ATM. Reminds me of when I tested it last month and then it failed again. Looks as new orders are okay, but older ones with credit card have problems.

I think we need to wait for next renewals orders to debug the issue. Next renewals are coming on 25th of October.

Sincerely,
Tommy

October 11, 2018 at 4:51 pm #2809193

tomasP-10

Just to add, WC Subscriptions support told me they noticed that the error is showing a trailing slash in the URL.

Are you (WPML) adding a trailing slash to any redirects? They recommend me to set the siteurl and home with trailing slash and then re-enable automatic payments.

"This is a fairly tricky, unusual situation, and I'm not sure if this will fix it, but I've seen merchants who set the URL with a trailing slash, but set their redirects up without the trailing slash, and that causes problems."

EDITED: Never sent them the url with slash, gonna wait for the next renewals to more info

October 12, 2018 at 11:50 am #2811796

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

There was a problem in past now WPML adjust the slashes according to the request URL. Here is more detail https://wpml.org/errata/changes-in-the-way-wpml-handles-the-trailing-slashes-in-url-conversion/
So this should be not the problem. However, if it is true our debugging code will catch it.

So IMO we should wait for a failed order to see the actual reason.

I would like to adjust the code we added in WP Subscription plugin for debugging. Right now it will log the results for every request but we want it just when there is an error. So please replace the previous code with this one

if ($is_duplicate) {
    $error_data = array();
    $error_data['site_url'] = $site_url;
    $error_data['wcs_site_url'] = self::get_site_url();
    $error_data['wcs_site_url_parts'] = $wcs_site_url_parts;
    $error_data['is_duplicate'] = $is_duplicate;
    $error_data['global'] = $_SERVER;
    error_log(json_encode($error_data));
}

I have wrapped the code in the if condition => log the data only when WP Subscription detect the duplicate site.

Please let me know when you see an entry in the log file.

Thanks

October 22, 2018 at 11:46 am #2837871

tomasP-10

Hello,

I changed the settings from different domains to folders because of some payment gateway issues. I also updated the code, the renewals are coming soon, so I will write you how is it going asap.

Sincerely,
Tomas

October 23, 2018 at 12:44 pm #2842381

Sumit
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hi,

Okay! I am waiting for your feedback.

Thanks

October 31, 2018 at 10:32 am #2865216

tomasP-10

With the changes from domains to folders the problem disappeared. Everything is working fine ATM. Thank you for you support :).

Sincerely,

Tomas