Karen, In this specific case, is there a contact that you would expect to be associated with the cart? The tricky case about this scenario in general is that you must be logged in to the site in order to know if you are an "eligible" member. If someone is logged in then it should pull in the contact. The default is that if Satchmo can't conclusively determine your membership status based on your contact, then you're not a member.
Does that make sense? -Chris On Fri, Apr 29, 2011 at 10:44 AM, Karen Tracey <[email protected]>wrote: > I have a project that is using pretty much this code verbatim: > > http://www.satchmoproject.com/docs/dev/signals.html#putting-it-all-together > > to attempt to have some "members only" products. However, it is not quite > working because for some users no customer value is set in the cart when the > signal handler is called. From a brief look at the code it seems that the > cart is auto-created during add() ( > http://www.satchmoproject.com/docs/dev/signals.html#putting-it-all-together) > but when the cart "from_request" method is called it does not attempt to > auto-create a Contact for the user ( > https://bitbucket.org/chris1610/satchmo/src/04117718811e/satchmo/apps/satchmo_store/shop/models.py#cl-225) > if one does not already exist. For users who do not already have associated > Contact models, then, the custom function to check for the user's > eligibility to purchase the product finds no customer set in the cart and > thus can't say it's OK for the current user to add the item to their cart. > > I can't find any other reports of this problem, though, so I'm kind of > wondering if there is something odd about my project that is causing this > situation. Can anyone give me some feedback as to whether this does look > like a problem in Satchmo or if it might be due to something odd in this > particular project? > > Thanks, > Karen > > -- > 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. > -- 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.
