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 17 replies, has 2 voices.

Last updated by ipsow 2 years, 1 month ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
July 16, 2017 at 2:16 am #1320227

ipsow

I am trying to: keep a product in the cart

Link to my site:

I expected to see: my product in the cart

Instead, I got: when i add the product, after 2 refresh or clicks on other pages, the cart get empty.
I notice that it's happen when WooCommerce Multilingual is activated.
I tested with the default theme twenty fifteen and the problem is the same.
I see with firebug that the cookie session is deleted at the first refresh of the page after few seconds.

I have the latest version of wpml woo commerce and wordpress

any idea ?

regards

July 16, 2017 at 12:19 pm #1320305

ipsow

Note:

I see on my current theme (kleo theme) the cart cookie got deleted after an ajax call :

hidden link

And with fire bug i got this info when the ajax is called :

Set-Cookie	
_wpas_session=667ea902f01843ac12a069f225d2c3b7%7C%7C1500207996%7C%7C1500207636; expires=Sun, 16-Jul-2017
 12:26:36 GMT; Max-Age=1700; path=/
yith_wcwl_products=%5B%5D; expires=Sun, 16-Jul-2017 10:58:17 GMT; Max-Age=0; path=/
wfvt_1403280708=596b54d96dbb3; expires=Sun, 16-Jul-2017 12:28:17 GMT; Max-Age=1800; path=/; secure; HttpOnly

wfwaf-authcookie-660cc91bb95ab21b0fcf67e9b23f00fc=2%7C%7Cfe46fec196ca7548a8453761bb87d73b6378c597724568b43666dcac7113cee4
; expires=Sun, 16-Jul-2017 23:58:17 GMT; Max-Age=43200; path=/; secure; HttpOnly
woocommerce_items_in_cart=0; expires=Sun, 16-Jul-2017 10:58:17 GMT; Max-Age=0; path=/
woocommerce_cart_hash=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/

We can see that the cookie got deleted.
On default theme the cart get empty after 2 refresh but i don't see in firebug how the cookie got deleted.

Also I have checked the option at the bottom of the page of WPML for cookies and ajax call.
This not fixing my problem...

hope you can help me resolve this.

July 17, 2017 at 2:21 am #1320418

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello @ipsow,

Thank you for contacting WPML support. I'd be happy to help you on this.

#1
Could you please go to WPML -> Langauges -> Language filtering for AJAX operations and enable the " Store a language cookie to support language filtering for AJAX" Does this help?

#2
1. Please follow the debugging information provided here: http://wpml.org/documentation/support/debugging-wpml/ .
2. Repeat the action of creating the problem.
3. Copy and paste the contents of debug.log (log file inside the /wp-content/ directory) here for me to see.

Look forward to your reply.

Thanks

July 17, 2017 at 6:03 am #1320446

ipsow

Hello,

The #1 was already checked as I said on my second message.

Here is the log I got by repeating the problem, note that I did the test like 4 times at 8am and those log didn't move so I don't think it log anything about the problem :

[17-Jul-2017 01:54:09 UTC] PHP Warning:  hash_equals(): Expected known_string to be a string, null given in /var/www/vhosts/xxxxxx.com/httpdocs/wp-includes/pluggable.php on line 2131
[17-Jul-2017 05:51:25 UTC] The The "add_to_cart_fragments" hook uses out of date data structures and function is deprecated since version 3.1.1. Replace with woocommerce_add_to_cart_fragments.
[17-Jul-2017 05:56:05 UTC] The The "add_to_cart_fragments" hook uses out of date data structures and function is deprecated since version 3.1.1. Replace with woocommerce_add_to_cart_fragments.
[17-Jul-2017 05:56:10 UTC] The The "add_to_cart_fragments" hook uses out of date data structures and function is deprecated since version 3.1.1. Replace with woocommerce_add_to_cart_fragments.
[17-Jul-2017 05:56:52 UTC] The The "add_to_cart_fragments" hook uses out of date data structures and function is deprecated since version 3.1.1. Replace with woocommerce_add_to_cart_fragments.
July 18, 2017 at 6:09 am #1321503

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link

This info is private and available to you and supporters only. Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note that:
+ Backup (both files and database) your site before giving us your credentials
+ It would be better if you give me the test site rather than the live site.

We'd like to request the permission to disable, enable and install themes and plugins for this site. Please accept this?

Look forward to your reply.

Thanks

July 19, 2017 at 9:13 am #1322549

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

I am working on this issue and will respond to you soon.

Thanks

July 19, 2017 at 10:10 am #1322605

ipsow

Ok, don't hesitate if you have questions or if you want me to do a specific test.

regards

July 20, 2017 at 7:46 am #1323349

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

I am not able to replicate this issue on your cloned installation in minimal setup so It seems like a theme/plugin conflict or a PHP error that is blocking some functionalities and creating such issues, so could you please perform the below steps and let me know if that helps?

Minimal Setup
If you disable all non-related WPML plugins, switch to one of default themes, the problem persists or not?
NOTE:
+ Make a backup (both files and database) for your site before updating/proceeding anything (Always a good practice!).

I look forward to your reply.

Thanks

July 20, 2017 at 8:21 am #1323380

ipsow

Hello,

I had already done this test twice and the problem is here. That why I ask for help here.

I did it again right now and it still here.
Currently I enabled only woocommerce + woocommerce multilangual + all wpml plugins
and I activated the default theme.

To reproduce the problem, note that it happen only when we are logged in.

- So get logged in, go to homepage, click on the button "ajouter au panier" mean add to cart in french
the ajax will add to cart.
- Just push F5 for a refresh
- Then go to the cart page by adding in the url : /panier/

You will see that the cart is empty

Hope you can find what's going on now

regards

July 21, 2017 at 6:25 am #1324191

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

I have created a video to show what I am able to see, could you please confirm if it's the same? hidden link

Look forward to your reply.

Thanks

July 21, 2017 at 6:45 am #1324208

ipsow

The video is not available.

But you should see the same I see, I tested on different computer/browser with and without proxies.

You should just log-in with the admin credential.
Go to the homepage, you will see 2 products in the middle of the page like the screenshot i attach. When you click on the button to add the chair in the cart,
if you refresh after that then go to the cart page : hidden link
The cart get empty.

It's easy to reproduce the problem, you don't see it ?

July 21, 2017 at 6:49 am #1324212

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

I couldn't reproduce it so I am asking you to check the video and let me know if there is anything I am missing. I have made the video public so please view it and let me know your thoughts.

Thanks

July 21, 2017 at 6:56 am #1324216

ipsow

Ok,

Try to refresh 2 times, and when you are in the cart to refresh also.

I just did with the same user account and mine get empty.

July 21, 2017 at 7:40 am #1324229

ipsow

I did test,
I don't know why, now 1 refresh it work.
If i do 2 refresh on homepage after adding cart, the cart page is empty...

Try the same doing 2/3 refresh on homepage and tell me if you can reproduce the problem.

Edit: I did also the test by click in the menu then going to the cart page and it get empty also

regards

July 21, 2017 at 9:35 am #1324345

ipsow

You could reproduce the problem now ?

You have to navigate on multiple page, do refresh.
You will see that the cookie get destroyed too quickly