Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Might WC_Cart::add_to_cart() cause issues … #17404
    Heather Huffman
    Participant

    I guess I couldn’t expect you to calculate totals before doing whatever it is that you’re doing, and that would likely be the only way to fix the issue, but being that you’re plugin is modifying the cart, you should perhaps consider it.

    in reply to: Might WC_Cart::add_to_cart() cause issues … #17399
    Heather Huffman
    Participant

    1. Free version of your plugin was used for a long time (possibly years) without this issue.
    2. Toggling activate/deactivate on the pro version of your plugin causes the issue.

    We have a custom AJAX add to cart feature of the website so that products can combined in custom selections, and those combinations receive discounts. Example:

    https://wildalaskasalmonandseafood.com/product/wild-variety-pack/

    On the server side, we’re basically just looping through the data that is sent with the AJAX request, adding products to the cart in the same way that WooCommerce itself does it in \WC_AJAX::add_to_cart(). Even though we have like 50 plugins on the website, and also that your free plugin also worked fine, your pro plugin pops the last product off the submission. After multiple calls to WC()->cart->add_to_cart(), something that your pro plugin does takes the last product off, unless I recalculate the cart totals immediately after looping. Also, when deleting these combinations of multiple items from the cart, I also need to recalculate the cart totals, or your pro plugin leaves one of them in the cart. Again, activating/deactivating your pro plugin shows that the plugin causes the issue, and this was not the case with the free version.

    It doesn’t really matter that the comment was old, it was just a clue that led me to the solution to fix what was going on, and since I don’t want to spend hours wading through your code to find why it happens, I thought I’d just send you a message. Even without setting up a free product coupon, your pro plugin is doing something to the cart, and maybe that process needs some attention.

    Thank you.

    in reply to: Proper upgrade process from non-pro version to pro #17373
    Heather Huffman
    Participant

    Thank you for your response.

Viewing 3 posts - 1 through 3 (of 3 total)