Selectabe product extras with price adjustments

Posts: 21
Joined: 03/15/2008

Hello!

I've been using Ubercart for almost a year and I simply love it! Keep up the great work!

I'm trying to achieve some simple function but I'm having a hard time with it, hopefully someone can help. I want to add selectable extras to a product when on its page. Say I want to sell flowers but I want users to be able to select: 1) no vase with it 2) vase type 1 3) vase type 2, where the first option doesn't change the price, the second one adds eg $10 to the base price, the third adds $20 to the base price. I'm quite sure I'll need to use the attributes function, but the most important thing is that I want to display images of all options. I've checked out Option Images module, but that's not exactly what I'm looking for, as I don't want to change the main image when an option is selected, I want to display small thumbnail images next to each option. Maybe that's even easier than what Option Images is doing...

Thanks in advance!

Rob

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hey Rob - glad Ubercart has been working out well for you. Laughing out loud

What you'll probably end up having to do is making sure you're displaying the options as radio buttons instead of select lists and then theming them to include the images. You can override the titles of the options at the theme level in Drupal to include the appropriate HTML for the corresponding thumbnail image.

There's an FAQ on overriding theme functions if you need it.

Posts: 21
Joined: 03/15/2008

The second thing I love here at Ubercart is the speed of the reply to a question. This gives extra value to what is already worth a lot!

What you say is probably the best way to go. But I need to make sure that my client, who will use the site later, will have no difficulties uploading and displaying those thumbnails. I like the way Option Images module does its hook_form_alter()-s and adds an extra image upload column to the attributes page. The only thing I couldn't figure out is how I get those images to display next to the options instead of the main image area. I know you're not the maintainer of it but the person who is is very busy and cannot handle any support requests. There might be some interest in this function for other Ubercart users too, maybe now, maybe in the future.

Thanks Ryan!

Posts: 5269
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Yeah, unfortunately I've never looked into his code, but my hunch is that he's storing the image filepaths in the database with some sort of association between the image and the option ID. I'd look into the .install if there is one to see what the DB structure is like for the module.

Posts: 21
Joined: 03/15/2008

Thanks for your help!

I'll try to figure out something with contemplates, there might be a way to achieve what I want.

Rob