I have been setting up a WooCommerce store on an existing website and I have been having a problem where the Add to Cart button's form sends the user to a URL that begins with http, which gives an error in most major web browsers and is not processed by the server. The same occurs if you try to update any of the cart's settings, such as the address and the quantity of product in the cart.
I have tried the following:
- changing the website URLs in the wp_options table in the database
- using SSL plugins such as Really Simple SSL, which doesn't solve the problem
- reinstalling the SSL certificate to force HTTP to HTTPS redirect
- using WooCommerce's Force SSL setting to force HTTPS
- overwriting the default cart templates, which does not work since the form action URLs are generated by PHP
I'm not sure what else to do to solve this. Any help with this would be greatly appreciated!
CodePudding user response:
Few troubleshooting options to be followed :
Check whether you have changed the URL to https in two places and not just one ?
WordPress Address (URL) / WP_SITEURL: The address where your WordPress core files reside.
Site Address (URL) / WP_HOME: The address typed in a browser to reach your WordPress blog.
You mentioned in comment below the question that you face issue in updating the URL via dashboard. The reason may be that you might have hard coded the URL in config.php which overrides the dashboard settings which comes from db values.
Hard coding values of URL settings in the wp-config.php file makes you lose the ability to modify them from the dashboard.
So, now if the above statement is true then proceed changing the values in config.php as follows
- Edit your wp-config.php file.
- Define your WP_HOME and WP_SITEURL settings by inserting these lines towards the top:
define('WP_HOME','https://example.com'); define('WP_SITEURL','https://example.com');
In case if its already perfect then try changing these two values in db as follows
Navigate to wp_options table in phpmyadmin
Your wp_ prefix may differ depending on your installation settings.
Click edit beside either the siteurl or home entries.
You may need to search for them with the Filter rows function at the top.
Enter in your new value in the option_value field, then click Go