• Resolved Joe

    (@joecole1)


    On my website, when logged in to an account, I am unable to remove the last item from the wishlist, unless I remove it, go to the page again, and remove it again. Then it persists.

    My basic troubleshooting has involved ensuring the javascript event for removing a product from the list fires (it does) and checking the cookie. The product id remains in the cookie until the second time removing it from the wishlist.

    I’m at a loss here. Can you help me troubleshoot? I don’t know that there’s anything wrong with your plugin… could be caching, redis or fastcgi caching… but I just don’t know.

    It does not seem to happen to guest users without an account.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Joris van Montfort

    (@jorisvanmontfort)

    Hi Joe,

    Currently I am on vacation, but I will look into this when I come back. That would be August 6th.

    Maybe there is some issue with the cookie path, but that’s just a wild guess.

    Kind regards, Joris

    Thread Starter Joe

    (@joecole1)

    No rush! Enjoy your vacation…

    I’ll try to troubleshoot and post some thoughts here in the meantime. It’s not a site-breaking bug, and I have so much going on on my store it could very well be an incompatibility with something else.

    Here’s the cookie info after adding one product: https://imgur.com/3YRijmj
    After adding two: https://imgur.com/UCIc9eD

    When removing a product, the cookie goes back to one id just fine, but when trying to remove the last product, it stays until the second time visiting the page and removing again.

    And in the user meta, the value goes from:

    a:1:{i:0;s:4:"5841";}
    to
    a:2:{i:0;s:4:"5841";i:1;s:4:"4915";}
    

    It is a cookie issue, although I’m not quite sure how yet.

    After removing the last item, the cookie still has the last product id in it, even though the user_meta wishlist key goes to value:
    a:0:{}

    Looking into it further.

    • This reply was modified 5 years, 3 months ago by Joe.
    • This reply was modified 5 years, 3 months ago by Joe.
    • This reply was modified 5 years, 3 months ago by Joe.
    • This reply was modified 5 years, 3 months ago by Joe.
    Plugin Contributor Joris van Montfort

    (@jorisvanmontfort)

    Hi Joe,

    I thought I had already replyed to this, but anyway.

    I had a look at the site parisbloom.com wich I see on your screenshots, but I can’t seem to find the wishlist functionality. If you want me to have a closer look, please email me at: [email protected] and tell me where to look.

    I will see if I can help.

    Kind regards, Joris van Montfort

    Thread Starter Joe

    (@joecole1)

    Joris, the shop is currently behind a login only during pre-orders for our customers.

    If you don’t mind creating a login, you can see it at https://parisbloom.com/shop/

    Plugin Contributor Joris van Montfort

    (@jorisvanmontfort)

    Hi Joe,

    I had a look a the site and I found the problem. Please update to version 1.2.8 as it contains a fix for this issue.

    Kind regards, Joris

    Thread Starter Joe

    (@joecole1)

    Great, thank you!

    Just curious, what was the issue?

    Plugin Contributor Joris van Montfort

    (@jorisvanmontfort)

    It was a common bug, not specific tou your website alone. I was setting the cookie in php also on page load if the user was logged in and had a wishlist stored. This way the cookie changed to a session cookie when the user was logged in. The session cookie would not be manipulated correctly by the JS code. The new situation is a JS cookie. When logged in the wish list is also stored as user meta so it can be called after user login. The user meta was already in the plugin. The main difference is that the user meta does not get witten to a session cookie.

    Thread Starter Joe

    (@joecole1)

    Awesome, thanks for tracking that down. I thought that was what was happening but am not experienced enough to find it myself!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can’t remove last item.’ is closed to new replies.