Discussions

Show products only to certain users

I'm using DC for a photographer, she wants to be able for her customers who have had a photo shoot to select and buy photo's online.

My solution so far has been to add a product_type for a photo, this consists of the following fields:

Product SKU
Title (text)
Photo (image)
Client reference (Customer profile reference using the select widget)
Price
Status

Now I am wondering how I could best go about creating a display for the product.
I need to make sure that when a user is logged in and they have products of the type Photo (customer profile reference = logged in uid) they can open preferably a page containing all photos with for each photo an add to cart form.

Anybody good ideas?

Posted: Jul 16, 2011

Comments

rfay Randy Fay on July 18, 2011

I think you may want to use one of the node access modules, like Content Access. You can either have a permission for each customer - there may be better ways. Or you may have to configure a group per customer, which doesn't sound very scalable.

Qubical on July 31, 2011

Thanks for your reply rfay,
I'll have a look at that.

Scalability shouldn't be the issue, it is going to be a very small business and if it does happen that she gets as successful that she needs a better system I'll probably have the resources for a more scalable solution.

** UPDATE **
I couldn't get passed the idea that my initial thought was wrong.
Yesterday I recreated my base content-types and product here is how I solved it:

Created an extra product-type with the specs I needed.
Created a content type with user reference field and product reference
Created a panelpage to hold my views, here I used context to get the ID of the logged in user.
Created a view -> content pane to show all products of the new product type where the user reference matches the UID gotten from context.

Works like a charm!