Sandun
Sandun

Reputation: 5

Woocommerce add to cart button not working when user not logged in

Woocommerce add to cart button not working when user not logged in. but when a user logged in its works fine and also when I disable ajax add to cart(It reloads the page when adding the item) its works fine too. ?wc-ajax=add_to_cart call returns 302 error when this happens, but when a user is logged in it returns 200 successfully.

I disabled all the plugins and tried also but it didn't work.

Upvotes: 0

Views: 1048

Answers (1)

Sheshan Narada
Sheshan Narada

Reputation: 141

I had a similar issue.
Then I found one of the tables on the database was missing. You can check that by going to Woocommerce>Status and check if there are any missing tables. Mine was "wp_woocommerce_sessions" table.

Fix: Goto Tools tab on Status and Run the "Update database" tool and "Verify base database tables" tool.
My issue was resolved after that.

Upvotes: 0

Related Questions