• Resolved lucidlips

    (@lucidlips)


    I recently migrated a client website to a new host and updated their entire platform and plugins. Everything appeared to be working fine until I realised the add to cart function wasn’t working. When you attempt to add to cart the product page you’re on refresh’s and nothing is added to cart.

    I have tried everything I can think of to fix this with no luck:
    – removed woo theme files
    – switched to 2015 theme
    – disabled all plugins
    – tried combinations of those /\
    – replaced the woocommerce plugin
    – saved permalinks every time I did something
    – installed soap on the server (only flagged system status issue)
    – tried everything again

    I’m left to believe there is either something wrong with my host setup, or I have an issue with my database. I appreciate any help on this issue as I’m pulling my hair out and our client is stressing.

    url: https://www.absolutesoulsecrets.com

    https://www.ads-software.com/plugins/woocommerce/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter lucidlips

    (@lucidlips)

    I also did a fresh installation of wordpress and woocommerce to see if my problem persisted and it didn’t. I set up wordpress/woo in a sub folder with a new database using the 2015 theme so I could test a dummy product, the add to cart function worked properly.

    So I can rule out hosting issues and can only assume I have an issue with my database? anyone have a remedy for an issue like this?

    Plugin Support Mike M. a11n

    (@mikedmoore)

    Automattic Happiness Engineer

    This can sometimes be an issue with session.save_path not being set in your php.ini file. Since the new installation works, that may not be the case. But its worth taking a look.

    Thread Starter lucidlips

    (@lucidlips)

    Thanks for the suggestion Mike, I didn’t expect php.ini to be the issue as the dummy site worked fine. I tried it anyway, set up a new folder in the root with correct ownership and permissions and changed the session path to that location. Alas, nothing changed.

    At this point I’m suspecting commentmeta table data may be the source of my issue. woocommerce uses that table and Im suspecting it may use it for session data. That table was severely bloated so I recently cleaned it out and optimised it. It’s the only remaining component that I think may be the cause for this issue. I am happy to take suggestions if anyone has any.

    Thread Starter lucidlips

    (@lucidlips)

    I just removed all products from my test server and truncated the commentmeta table. I then set up some simple products and found that I am able to add simple products from the /shop or /shop/category pages but am still not able to add to cart from the product single page.

    I got the same results when I tested the above on the 2015 and 2013 themes with all plugins but woo disabled. Now I’m really confused as my problem suggests a possible jquery or js conflict, but I have no console errors and you would think switching themes would also rule that out. Again, I’m open to any suggestions.

    Plugin Contributor royho

    (@royho)

    From my testing on your site, so far I was able to add variable items to the cart as seen here https://cld.wthms.co/15xs3/1nrMmAMB and I was able to proceed to checkout thereafter.

    Thread Starter lucidlips

    (@lucidlips)

    I finally found the source of the issue and have since fixed the problem. I was on my way home from work when you replied royho.

    After all my that above /\ the problem ended up being related to cookie data, more specifically it was a .htaccess problem. I recently replaced wordpress and moved it into a subfolder so I could seperate all the residual crap that sitting in the root. As it was a fresh install and not a migration I didn’t realise there was an additional .htaccess file in the subfolder (stupid me). So woocommerce has been writing cookies under the rewrite conditions set in the subfolder .htaccess file but the browser was trying to read cookies relative to the root .htaccess file.

    Once I realised that after 2 full days of troubleshooting, it was a 30 second fix. Hopefully my mistake and troubleshooting will help someone else save 2 days of their life haha. But hey, I learnt a lot so I’m taking that as a positive.

    Plugin Contributor royho

    (@royho)

    @lucidlips – no worries, thanks for replying back and just glad everything is working for you now.

    Thread Starter lucidlips

    (@lucidlips)

    I’m glad too haha, thanks for going to the effort of checking it out, much appreciated @royho.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘add to cart redirect loop’ is closed to new replies.