Posted by psyte on April 13, 2010 at 1:50pm
I am using Ubercart 2.2 for my online store. I want to start selling custom banners that will use a picture provided by the customer. Problem is there doesn't seem to be a way to set up an Attribute with Ubercart that will allow a file upload. Is there any way to set up something like this?
Worst case scenario, I could set up a file upload page and send the link to users after they place their order, but I would really prefer it be done along with placing the order.
Thank you.
Comments
=
Can you add a CCK upload image field to the product content type? Then the customer could submit their image before placing their order. At least I think that might work. You could always try it out and remove the field if it does not.
----------------------------------------------------------------------
http://classicvinyl.biz ~ http://vinylclassics.biz ~ http://jazz.vinylclassics.biz
My YouTube Channel
I gave that a shot, but
I gave that a shot, but unfortunately the field it added is only listed when I create the content type. Basically when I create a new product using the content type, the field is there and I can upload an image, but once the content itself is created, only the Ubercart attributes are available to the user. Hope that makes sense, kind of hard to explain.
-
Your explanation makes perfect sense... I am not sure what I was thinking when I proposed the idea. I guess that with a CCK field the user would have to be creating content of some sort. I wonder if there is some way you could adjust the workflow so that after placing an order (with specs, number, etc.) the user would be redirected to another page where they do in effect create a content type, which includes the image. Just thinking out loud here.
----------------------------------------------------------------------
http://classicvinyl.biz ~ http://vinylclassics.biz ~ http://jazz.vinylclassics.biz
My YouTube Channel
You need to use the
You need to use the UC_node_checkout module. That module allows you to associate a content type with a product - when the user purchases their product, they get taken to the node creation form of your custom content type. On that form, you can place whatever input widgets are necessary for your custom digital product. When the customer submits their form, they are returned to the Ubercart checkout process.
What you're describing is exactly what I'm setting up myself: an online store where people can upload images and additional information during the purchase process for the purpose of creating customized digital products - such as custom banners, custom video sequences, and custom 3D models.
I've you're willing to wait a few beats, I'm writing a book covering this called "The Missing Ubercart Manual". If you're doing this for an employer or client, I can handle this part for you right quick. (There's actually a series of additional issues involved with customized digital products that you may not have realized yet.)
-Blake
www.BlakeSenftner.com www.MissingUbercartManual.com www.cg-general-store.com www.droplabs.net
requiring user account
Thanks, Blake. So far that looks like it will work great. I got everything set up and it works fine under my admin account, but the problem is it's prompting anonymous users to log in or create an account (User clicks "Add to cart" on the product and instead of just being directed to the create content page where they could upload the image, they are told "You must login or create a user account to continue"). I checked the permissions and anon users do have permission to add that content type, so I'm not sure why it is doing this. Its awkward to require users to create an account in the middle of setting up a product so I really don't want this happening. Do you know of any way around this? The tutorials I found on the module don't mention this anywhere.
Make sure your store
Make sure your store administration is configured to allow anonymous customers. I suspect that's the issue.
In my setup, the user is anonymous right up to the point where they enter their credit card info, and then at that point they are given the opportunity to enter their own username & password, or a username & password is assigned to them.
-Blake
www.BlakeSenftner.com www.MissingUbercartManual.com www.cg-general-store.com www.droplabs.net
node checkout setting
Ok turns out it was a setting of the Node Checkout module.
"Use UC Node Checkout to prevent anonymous node add access for node types it governs" is checked by default. Just needed to uncheck it.
The only thing I don't like about this module is that I can only link the photo upload content type to one product (i.e. my content type that allows users to upload photos is called "Upload Image"; under Node Checkout Settings > Node Types, I can only link the "Upload Image" content type to one NodeID/SKU). I have multiple products that need to allow photo uploads so it appears I have to create a different content type to link to each and every product instead of being able to the same content type to all products. Essentially I would have to create another copy of the "Upload Image" content type for each product, which would be very time consuming. Any way around that or is that just how the module works?
It looks to me like entirely
It looks to me like entirely different content types need to be created for each different product.
My most basic Node Checkout node type has more input fields than one image upload. Overall, my different products with Node Checkout associated node types all have very different sets of input fields, so I'm not feeling the urge to try to reuse one node type across multiple products.
I'm not sure if the architecture of Node Checkout would allow it. It would probably be a good idea to sit down and read through that module's code. Probably learn quite a bit...
Sounds like you may want to think of decoupling the uploading of images from your Node Checkout node types, and have a separate node type that allows users to load their own library of private images. Then, when products using Node Check are purchased, the node form is just browsing the user's private image library (and perhaps a store library too, for customers without an image to upload.) Your different products would still need a different content type for each browse the library node add operation, but they'd all be identical with only the help text changed as appropriate for the different products.
-Blake
www.BlakeSenftner.com www.MissingUbercartManual.com www.cg-general-store.com www.droplabs.net
a series of additional issues?
We are just putting up a site for an event and we are selling Ad space for the "Event Souvenir Book" (printed material) in full, half and quarter page increments. I can easily get the product setup correctly using attributes for the pricing variation but we would like to allow the buyer to upload either a document or an image file containing their own ad copy. I keep seeing a lot of people who want this functionality, but zero examples of how to implement such a beast. If you have any ideas, it would be greatly appreciated if you shared them here (I really can't wait for the book to be released).
The key for what you're
The key for what you're talking about is the Node Checkout module and a custom content type whose node creation form is used to collect whatever information you require from your buyers.
This posting here is the essentials of using Node Checkout:
http://drupaleasy.com/blogs/ultimike/2009/03/event-registration-ubercart
And after that, it's just a matter of knowing your way around the Forms API to create the data collection form that is your custom content type's node creation form. This will get you your buyer's information, and from there it is up to you how it's integrated into your systems.
A lot of what I'm covering in my book starts with that, and then moves forward to product watermarking, custom digital product creation, using Services for distributed processing & deployment, and finally all the theming and drupal API glue that ties everything together.
-Blake
www.BlakeSenftner.com www.MissingUbercartManual.com www.cg-general-store.com www.droplabs.net
Got that but ...
I went through this and got it working - I was even able to add an "Image" field type. I guess I wasn't clear before and what I am struggling with is that I want to apply product attributes options to handle the various pricing (full, half, quarter) and I'm having trouble - I obviously missing something - tying it all together with a product class that incorporates the attributes?
Let me ask this, using the UC_Node_Checkout example you provided, can I assign product attributes(with pricing options) to the "Event" product class and then tie that together with the Registrant Profile? I looked at this and it wasn't obvious to me. I must be missing something.
How comfortable are you in
How comfortable are you in custom module development? I ask, because my Node Checkout based custom content types are all created in a content type implementing module, and I found it quite easy to tie things like product attributes to products and classes when working at that level (rather than with CCK and using the UI to create the custom content type.) Perhaps I'm not understanding what you're not understanding...
I hope you get that the Node Checkout custom content type is purely for information gathering on your side, and only binds to your product(s) through logic you implement in your own module, or through something like Conditional Actions, Rules or Triggers & Actions. I actually use the Conditional Actions method described by that blog post I gave above to finalize the purchase of custom products after the customer's credit card has been charged - however, in the Conditional Action triggered logic, I call a routine in my custom module that is doing more work than simply setting a variable and re-saving the node.
It sounds like your issue is a bit earlier in the transaction than at checkout. To get a better idea of the data you're working with, go to the edit page of one of the products in your store, take note of the node id shown in the browser's URL, and then in a new node (or other place you can execute some raw php within Drupal) execute this:
$node = node_load( integer-node-id-of-your-product );if ($node)
error_log( 'product [name-of-your-product] dump: "'.print_r($node,1).'"' );
You may not have access to your php error log, so I use something like this to handle such situations rather than a direct call to error_log():
function _dbgReport( $msg ){
$msg = $msg . "\n";
file_put_contents( '/home/bsenftne/drupal_debugging_log.txt', $msg, FILE_APPEND );
// error_log( $msg );
}
Anyway, this raw dump of a product node will show you that your product node has an array of 'attributes' objects, with each owning an array of 'options' objects. Depending upon the logic of what your attributes and options mean, you'll have multiple opportunities to insert logic into the browse-your-store-and-make-purchases activities of your customers. Conditional Actions has a wealth of places you can attach logic.
You may also want to look at the Cart Links module. I find it useful to describe 'pre-configured' product attribute/option combinations, and provide "buy now" links right in the product descriptions.
To answer your last question directly: I think so. When a product is purchased, you need that conditional action at checkout to tie your custom content type to the purchasing order and now-non-anonymous user. Afterward, your event registrant node will have a valid user id as well as a valid order id, and with that you can create logic to do whatever is necessary. Routines like uc_order_load($order_id) come in very handy when wanting to see specifics about an order...
-Blake
www.BlakeSenftner.com www.MissingUbercartManual.com www.cg-general-store.com www.droplabs.net