Answer the question
In order to leave comments, you need to log in
How to make it so that when exiting a wordpress site. woocommerce plugin or rather its cart did not save cookies?
When adding products to the cart and exiting the site (an log from the site), the cart still stores data about the products in cookies.
How can I make sure that cookies are automatically deleted after leaving the site (from my account)?
And it turns out I go under 3 different users and the goods in the basket are the same.
Even if a new user is registered, he still has products that he did not add.
Help solve the problem. website www.fotolesson.com
Answer the question
In order to leave comments, you need to log in
Hang a hook on the user's exit
<?php
function your_function() {
// тут чистим куки
}
add_action('wp_logout', 'your_function');
1. You do not need to "clear cookies", but "empty the trash".
2. If you are not a developer, it is better not to try to edit the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question