Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Bond 18 posts 139 karma points
    Jun 29, 2021 @ 13:05
    Andrew Bond
    0

    Product unpublished while in checkout process.

    Vendr is not removing a product from a users basket when a CMS user un-publishes that product while it is in the checkout process. Is this is the expected behavior?

    If this is the expected behavior how can I find active orders (those currently in checkout) which have an order-line for a given product and remove that order-line?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Jul 05, 2021 @ 14:14
    Matt Brailsford
    0

    Hi Andrew,

    This is expected behavior as generally speaking, once something is added to an order, we see this as a commitment. If it was available to order when the person added it to the cart, it should really be honored.

    If you want the order line to be removed however, you'll need to create an event handler to listen for products becoming unpublished and then update open orders that have that product in them to remove those order lines.

    You'll probably need to do this at the DB level though as we don't really have an API for blanked removing products from orders. If you do update the database though, be sure to invalidate the order services cache thought so those changes take immediate effect.

    Matt

  • Andrew Bond 18 posts 139 karma points
    Jul 07, 2021 @ 07:17
    Andrew Bond
    0

    Thanks Matt,

    You are right the way in which we work with some products is a little unusual and will require some additional logic to support.

    Thanks for your help.

    Andy B

Please Sign in or register to post replies

Write your reply to:

Draft