Vote up!
Vote down!

Online print shop

Hi everyone,

I have been trying to figure this one out and I can't see it.

I am creating a commerce site where the users will upload their own photos and then pick diferent size of the photos to print. Easy, right?

Well my questions are:

1. Should I make the photos independent nodes or should I make an entity out of each (using something like ECK)?

2. To order different sizes (each size has different price) of the same photo how will I added to the order? (reference field in the product?)

I will love a super simple solution, but I understand if there is no such thing as a super simple solution.

Thank you,


Asked by: emilorol
on January 29, 2014



Do you mind sharing how you solved it in the end? A friend of mine is looking for a similar solution to offer a photo print service.

- ñull on February 5, 2018

1 Answer

Vote up!
Vote down!

Hey Emil, sorry it took so long to respond. In my opinion, this is a perfect place to use line item fields. If you add an image field to your product line item type, there's an option to expose the field widget on Add to Cart forms. This means your customer can directly upload the image to the line item where you can access it for display in the cart / checkout and in back end interfaces for fulfillment.

You'll want to take care to manage the file uploads properly, for example using a tokenized subdirectory (perhaps by uid) so your image upload directory doesn't get too large and degrade performance.

Additionally, if you only need some products to have the field and not others, you may need to define a separate line item type / product display node type specifically for photo products. You can do this directly in code if you're a developer or else use Commerce Customizable Products if you are not.

Ryan Szrama
Answer by: Ryan Szrama
Posted: Feb 24, 2014


Thank you Ryan for the answer.

The idea of using the UID for the image directory it is a good idea, I am also planning to have the file system private to protect the user images from direct linking or download.

There will be only one type of product "Photo" with different prices depending on the size of the print the user want.

My only remaining question will be:

If the user upload the photo to the "line item" (I am planning in using pupload to upload multiple images at once from multiple platforms) does it mean the user will have to re-upload the image every time he/she want to order a new set of prints of the same image?

Note: I was thinking on storing the images as nodes (one image per node) then add a node reference to the product, but I will have to do some coding (Yes, I am a developer) add the product to the cart with the node as a reference attached.

Your thoughts?

Once again thank you.

- emilorol on February 25, 2014

I really think it's up to you. You can create a workflow where they upload photos to a node first and then use an entity reference field on the line item to point to the appropriate image if you want. The other option would be to just create a View of previously purchased prints and support reordering, whether that means referencing the previously used files or duplicating them.

- Ryan Szrama on February 25, 2014

I tried to do this in Commerce 8.x-2.5, but it seems that many things changed since the response was written. Is this still possible? Is there any resource that would give me some detailed description or may be a video tutorial somewhere?

I tried to add an image field to the Default Order Item type, but after adding a default product it would not present me with any image upload facility.

- ñull on April 3, 2018