By cschults on
I'm researching how to allow our registered users to add grocery items and recipe ingredients to a printable shopping list.
Can anyone recommend any modules, or direct me to Drupal-powered websites with this functionality?
Note: People can NOT order online, at least not yet, so we really don't need a full-blown e-commerce solution, but would entertain one if we could just use the shopping list functionality.
Comments
_
I don't know of any sites off hand, but it should be pretty easy to do. I would probably just do this with cck and views but you may want to check out the http://drupal.org/project/recipe module. Then take a look at the http://drupal.org/project/print module for print optimized pages.
Thanks
Thanks WorldFallz. After posting, I did some more research and was wondering if CCK and views could do the job. I'll investigate further.
Manage via user's profile
I'm wondering if I could create a shopping list user profile field and store the shopping list as a serialized array? Then I would need to create functions for reading, adding, updating and deleting items.
_
I'm sure you could-- there's pretty much nothing that can't be done with drupal. Seems like a lot of work though-- i'd probably just make a 'shopping list' content type with a multivalue text field and just use views to create a tab on the user's account page to display their list, lol.
To get a little fancier, you could create a 'shopping list item' content type instead, with fields for the different properties of an item (size, type, quantity, etc), and again use views to create a 'shopping list' as a tab on the user's account page.
WorldFallz, I won't give up
WorldFallz, I won't give up on CCK and Views yet, but I'm wondering if they are the right fit.
Basically, based on my limited understanding of CCK, I could create a "shopping list" content type where one could add one or more items. But, each list can only be viewed by the user who created it. Is this possible? (This is why I started thinking about using the user's profile.) Also, I would need the ability to programmatically edit the list from other modules and pages.
I also thought of creating a "shopping list item" as you suggested, but realized that could result in a large number of entries. For example, say we had 1,000 users who on average have 25 items on their list. That's a lot of content just for this one feature.
Thanks again for your suggestions.
_
Core drupal doesn't include the ability to limit viewing nodes, for that you need to use one of the available access control modules (ie private, simple_access, content_access, etc).
As for programmatically accessing and modifying the node, you can use the drupal node_load function to load any node you wish and modify and display it as desired.
You CAN have privacy with CCK and Views2
If you use a Views filter with 'User_current' and force it to YES. Only the creator of the list will be able to see the view. I have done this on a private calender in Drupal.
Works like a charm.
Morten
_
Just to clarify-- view access control is NOT the same as privacy. Not being able to use a view does not mean the nodes themselves, which are listed in the view, are private. Any user with the URL or who can guess the URL will be able to see the actual nodes.
How did you do it???
Hi, I would be really interested to know if you managed to create a shopping list option with CCK and Views and how you did it as I am trying to do a similar thing.
Solution summary
warrenpaulnash, no, I did not end up using CCK and Views for various reasons. I ended up creating a new user profile field and storing the shopping list as JSON serialized data. The rest was implemented using custom PHP and jQuery outside of Drupal.
You can see it in action here:
http://www.pccnaturalmarkets.com/shoppinglist/