Support » Plugin: WooCommerce Advanced Free Shipping » Empty card with error on anonymous users

  • Hi!
    When I create a rule of type with the number of items in the Cart I get the following error with anonymous users: “you have been removed from your cart because it can not be purchased.
    If I login with the WordPress admin it works fine.
    The rule I have set is for “3 products or more in the basket”.
    Please, can you help me?

    • This topic was modified 8 months, 3 weeks ago by  lballester.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    How did you lead this back the Advanced Free Shipping? The plugin doesn’t have any capabilities to do what you’re describing / it shouldn’t be able to lead to something like that.

    I’m also not entirely sure what is happening. I know WC can remove products from the cart when they’re out of stock for example, but ‘you have been removed’ is something I haven’t seen before.

    Let me know!

    Cheers,
    Jeroen

    Hi,
    It may not be the module that directly empties the shopping cart, but it is a consequence of this. There are several cases explained:
    If the rule configured with Advance Free Shipping is of any type except “Quantity” everything works correctly.
    If the rule configured with Advance Free Shipping is of the type “Quantity” then the error described in the ticket appears.
    If the rule configured with Advance Free Shipping is of type “Quantity” but we are logged in with the admin user then everything works perfectly.

    Can you test it?

    Thank you.

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    I’ve tested this and cannot replicate it unfortunately.

    When is the cart getting emptied when not logged in? Could you maybe post a screenshot of the error message?

    Is your error log showing anything?

    Thank you,
    Jeroen Sormani

    Hi, here you are.
    Error log is empty, no errors.
    https://www.screencast.com/t/ade5Flnyj
    Thanks!

    • This reply was modified 8 months, 1 week ago by  lballester.
    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Thank you for the screenshot.

    Its really strange though! It looks like its missing the product name, could it be the product was removed / set to draft / password or anything in the meantime? Maybe you can add it because you have permission when logged in, but not when logged out?

    I still can’t replicate / think of any reason this may happen due to my plugin.
    Have you tested this with other conditions? Is is solely with ‘quantity’? Do you have any other condition setup alongside that one?

    Could you check what happens if you deactivate the WAFS plugin for a while to see if the same thing still happens?

    Cheers,
    Jeroen

    lballester

    (@lballester)

    Hello, the error only happens when there is a rule with “quantity”, the other rules work perfectly in all cases.
    If I turn off the module everything works fine.
    I also think that it may be the agreement of the type rule “quantity” with some other plugin like WPML or others.
    We are going to try to disable other plugins and tell you something.
    Thank you very much again.

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Thanks for verifying!

    I know you’re probably not a coder, but this is the code for the ‘quantity’ condition (the only code that is differently executed from other conditions)
    https://github.com/JeroenSormani/WooCommerce-Advanced-Free-Shipping/blob/master/includes/class-wafs-match-conditions.php#L161

    Its not exciting at all.. Just doing a simple compare check.
    (just saying from a coding perspective it doesn’t make any sense this is happening)

    Looking forward to your results when other plugins are deactivated!

    Cheers,
    Jeroen

    Hi!
    We have discovered that if we disable the Woocomerce Multilingual plugin the error disappears. It seems that when executing the WC () -> cart-> cart_contents_count function the shopping cart is emptied.
    What is really disconcerting is that logged in with the admin user everything continues to work.
    Any idea?
    Thank you very much.

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Good thing you found that out!

    Finding the deeper cause is going to be harder..

    Are you able to contact WPML about this and see if they have any clues?

    Cheers,
    Jeroen

    hi!
    In the end we have tried two more shipping plugins that work with our configuration without problems, also use the functions of WC () -> cart-> cart_contents_count but in this case nothing fails.
    If you want I’ll give you the name of the 2 plugins so you can check it in your module.
    The truth is that your plugin is great, it’s a shame that we do not work with Multilingual Woocommerce
    Thank you very much for your support.

    Plugin Author Jeroen Sormani

    (@sormano)

    Hi,

    Those other plugins probably don’t work with WPML in the same way mine does (since I’m using a custom post type, WPML is probably doing something to translate those).

    I found the function in WPML that causes this, though I’m not sure yet about a solution since I can’t test how other parts / plugins react to my change.

    Could you maybe pass this to the WPML support guys to see if they can figure out a appropriate fix for this?
    https://cl.ly/0L1g1c3P080I

    Cheers,
    Jeroen

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Empty card with error on anonymous users’ is closed to new replies.