add to cart problem
-
When I click on ‘add to cart’ it looks like its been added but just shows an empty screen. It works ok when i am logged in as admin. site is http://www.ntdeals.co.uk
-
Cookies are not being set after adding to cart. This could be caused by:
– server config
– server caching (varnish)Which host? You may want to check with them.
Logged in users get the WP logged in cookie which your caching rules probably account for.
Thanks Mike, its with 123reg, I will check with them
I’ve checked with 123reg about server config and server caching, they said that the caching wasnt handled on the server but could be due to caching plugins we are using (W3 Total Cache) or could be due to code in .htaccess file. the code he suggested i remove was between two of these – ## EXPIRES CACHING ## and is as follows:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType text/x-javascript “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 month”
ExpiresDefault “access plus 2 days”removing this hasnt made any difference to the add to cart issue, and the W3 total cache plugin has been deactivated for a week or more now.
123reg customer support asked for recommended server settings for woocommerce to see if the server config was causing the issue, here is an extract from the support chat session:
Danny: (12:19): I have checked your hosting package and cURL and SOAP are enabled. You are using PHP version 5.6 and MySQL 5.1.73.
Danny: (12:20): Please allow me a few more moments to check fsockopen.
Danny: (12:22): fsockopen is also enabled.Enable w3 total cache again, disable the caching rules in its settings completely, then deactivate it. w3 can leave remnants of itself behind, such as in your wp-content directory.
Thanks Mike but this doesn’t seem to have any effect.
Do you think it would be worth re-installing woocommerce?
I don’t think that will make a difference. Do you have any caching files in wp-content directory?
There is a cache folder in wp-content directory, with a blogs.php file and index.html file, and the following folders: config, db, minify, object, page_enhanced and tmp
I’d delete that. What other files are in wp-content? Have you cleared the rules from htaccess, and WP_CACHE from the wp-config.php file?
Delete the whole cache folder and its contents?
I removed the lines from htaccess that i mentioned earlier, see below:
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg “access plus 1 month”
ExpiresByType image/jpeg “access plus 1 month”
ExpiresByType image/gif “access plus 1 month”
ExpiresByType image/png “access plus 1 month”
ExpiresByType text/css “access plus 1 month”
ExpiresByType application/pdf “access plus 1 month”
ExpiresByType text/x-javascript “access plus 1 month”
ExpiresByType application/x-shockwave-flash “access plus 1 month”
ExpiresByType image/x-icon “access plus 1 month”
ExpiresDefault “access plus 2 days”Ill have a look at wp-config now
Yes, remove the cache folder as its no longer needed.
Ok, will do. I cant see anything like WP_CACHE in wp-config.php
Ive deleted the cache folder, the cart problem is still there. Not sure if this makes any difference, but this site runs on a multisite installation. Woocommerce is networked active, it does work on one of the other sites on the network. The layout is a bit messed up but you can see it working on http://www.bath-king.co.uk
Woocommerce is networked active
That may actually be related. WC doesn’t work across the network – it needs to be activated per site.
Is there a way of installing it per site? as far as i can tell, plugins on multisite set up are all installed through the main network wp admin
The topic ‘add to cart problem’ is closed to new replies.