Your cart is getting empty in a few seconds of add to cart.

This is mainly because the URL through which the product is accessed is not secure.
Make sure the product page is loaded using secure HTTPS URL.

If your web server is running Apache, you can easily redirect all of your HTTP traffic to HTTPS by adding the following code to your .htaccess file. This is the recommended method for redirecting WordPress running on Apache.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

If your web server is running Nginx, you can easily redirect all of your HTTP traffic to HTTPS by adding the following code to your Nginx config file. This is the recommended method for redirecting WordPress running on Nginx.

server {
listen 80;
server_name domain.com www.domain.com;
return 301 https://domain.com$request_uri;
}
Updated on November 6, 2020

Was this article helpful?

Related Articles