I hear you, but that doesn't solve my problem. I need to be able to allow many people add item to cart (as satchmo allows by default) but with the "Track inventory"=true and "Allow checkout with 0 inventory"=false make sure that satchmo _does not_ allow checking out while product.items_in_stock=0. That is the behavior I expected after setting those configuration options.
Similar problem resulting with the same bug is reported here: http://bitbucket.org/chris1610/satchmo/issue/1163/purchase-of-inactive-products-after-add-to So I was asking for ideas on how to workaround this as I was not able to find out how to hook to the moment in satchmo execution that happens when user presses the "Checkout" button and submits the cart for checkout. Also a potential problem with your solution would be that someone could potentially create a script that would add all of your products to cart and no one else would be able to put anything from your store to cart for an hour or however long until the cart cleanup script would kick-in. And since you are not notified on cart creation (as opposed to when someone submits an order) you wouldn't even know about it. -Michal On Jun 4, 11:50 pm, Alex Robbins <[email protected]> wrote: > Seems like the problem is that you want lots of people to put it in > their cart, even if you don't have that many left. That violates the > shopping cart mental model. In the real world, if a store is out of a > certain item, I can't put it in my cart. If you followed that same > principle here, then Chris' idea works. You would need to drop old > carts after a reasonable amount of time (maybe an hour?) with some > kind of cleanup script, but that seems doable. > > I haven't coded any of this, but it makes sense in my head :) > Alex > > > > On Fri, Jun 4, 2010 at 3:53 PM, Michal <[email protected]> wrote: > > Any ideas... anyone? > > > -M > > > On Jun 1, 9:23 am, Michal <[email protected]> wrote: > >> That would not help, because all I can check at that point is how many > >> other people have that item in their carts, but I cannot make > >> decisions on whether to allow add or not based on this. > > >> In the given use case at this point product.items_in_stock would still > >> be 2. So I will allow any number of users to add it to their carts. > >> And lets say none of them changes anything again before checkout - I > >> will still be left with -3 in the items_in_stock. ...and 3 very > >> unhappy customers. > > >> Do you see a way to verify the cart once user clicks "Checkout"? > > >> -Michal > > >> On Jun 1, 3:40 am, Chris Moffitt <[email protected]> wrote: > > >> > You could used cart_add_verify to do an additional inventory check before > >> > adding to the cart. > > >> >http://www.satchmoproject.com/docs/dev/signals.html > > >> > -Chris > > >> > On Sun, May 30, 2010 at 5:43 PM, Michal <[email protected]> wrote: > >> > > The use case is - the stock for a given product is 2 items and 5 > >> > > shoppers put the same product in their carts and proceed with checkout > >> > > process and place an order. The outcome will be -3 in the > >> > > product.items_in_stock. Looks like the whole inventory tracking > >> > > mechanism is encapsulated in an signal listener attached to > >> > > order_success and there is no validation done anywhere before or even > >> > > here. > > >> > > So - my question is - what is the best signal to connect to do cart > >> > > verification before it is passed to payment for checkout handling? Or > >> > > maybe there is another way to solve it without modifications to > >> > > satchmo core? > > >> > > Regards, > >> > > Michal > > >> > > -- > >> > > You received this message because you are subscribed to the Google > >> > > Groups > >> > > "Satchmo users" group. > >> > > To post to this group, send email to [email protected]. > >> > > To unsubscribe from this group, send email to > >> > > [email protected]<satchmo-users%2bunsubscr...@goog > >> > > legroups.com> > >> > > . > >> > > For more options, visit this group at > >> > >http://groups.google.com/group/satchmo-users?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Satchmo users" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/satchmo-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Satchmo users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.
