Hi,

Thank you for your advice. I'll look into that.
I guess worst case I just need to implement a cache for my current
solution.

Thank you

lzantal

On Jul 26, 10:06 am, davecap <[email protected]> wrote:
> You might want to check to see if the existing listeners built-in to
> Satchmo are affecting the behaviour.
> Try creating your own listener by copying the code from
> veto_out_of_stock, and then disconnect the satchmo listener:
>
> signals.satchmo_cart_add_verify.disconnect(listeners.veto_out_of_stock)
> Then connect your new listener
>     signals.satchmo_cart_add_verify.connect(veto_for_product_qty,
> sender=None)
>
> Also, be aware that depending on where you set up your signals they
> may be getting called twice per request. I had that problem once..
>
> - David
>
> On Jul 16, 2:21 pm, lzantal <[email protected]> wrote:
>
> > Hi all,
>
> > I wrote an app (productqty) that checks the product added to the cart
> > and it reduces the quantity if it is over the max qty set for that
> > product.( Eg: Limit 3 per customer, customer adds 5 it will be reduced
> > to 3). I have a working app but its not very efficent with large
> > carts.
>
> > I tryed to alter the added quantity through these signals:
> > signals.satchmo_cart_add_verify.connect(veto_for_product_qty,
> > sender=None)
> > signals.satchmo_cart_details_query.connect(veto_product_qty,
> > sender=None)
> > But my overwrite got ignored.
>
> > So I resulted using:
> > signals.satchmo_cart_changed.connect(veto_cart_changed, sender=None)
> > In that listener I loop through the cart-items and make the
> > adjustment.
> > It works great but it has a big overhead if the cart contains many
> > items.
> > I would like to use satchmo_cart_add_verify or
> > satchmo_cart_details_query since they provide the cart-item and
> > prodct.
>
> > Any help would be appreciated
>
> > lzantal

-- 
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.

Reply via email to