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?
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.
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?
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
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
is working on a reply...