11 replies [Last post]
gash's picture
Offline
Joined: 04/14/2008
Juice: 164
Was this information Helpful?

As a fairly new e-commerce developer, I wanted to ask about a fairly common site requirement -- product previews. I've received inquiries about building a product preview dialog that allows customers to "build" a product. The specific items in question are ladies' handbags. The store owner has a fised number of patterns, but literally hundreds of fabric choices (~260 at last count). The desire is for a dialog that will allow users to select their fabrics of choice and see a real-time depiction of how their handbag might look.

Easily solved using a javascript mouseovers, but that would require hundreds of photos (each handbag uses two fabrics and in some cases three fabrics, so the number of possible permutations would prevent either her sewing up samples or the taking of a vast library of images). I suppose flash can do it without the large image requirements? But I was thinking about being a bit more sneaky -- how about a div with a background image set to the fabric of interest. Overlaid on top of said div is a png with the appropriate regions of the handbag transparent, allowing the fabric pattern to show through. Might be really tricky to implement for adjacent regions of the handbag, I suppose. And utterly unusable in IE 5.5 and 6, so not really all that practical an approach, I suppose, even with pngfix.

Any suggestions on how to approach this issue?

Abilnet's picture
Offline
Uber DonorBug Finder
Joined: 12/28/2007
Juice: 718
Re: Product Preview Brainstorming

Good call, I'm also more than willing to find a "preview" solution to product(s). One nice example done with Drupal / Ubercart I like a lot is HERE...just wondering how it is done?!

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Abilnet wrote:Good call, I'm
Abilnet wrote:

Good call, I'm also more than willing to find a "preview" solution to product(s). One nice example done with Drupal / Ubercart I like a lot is HERE...just wondering how it is done?!

The frames site does a POST back to the server when the Preview button is pressed. It sends the attributes back and presumably the server builds a composite picture based on the attributes. (This can be done with the PHP image functions, http://us2.php.net/manual/en/ref.image.php, or you can use some other toolkit.) Simple enough to do in the case of the frames, since each attribute affects a different region of the picture.

That's one way to go about it. You could also use AJAX. Either would work for the case of handbags. I think it would be better to do this on the server rather than sending the client all the images for all possible combinations. Plus you'd avoid the problem of dealing with browsers that don't handle images properly. I don't know how you would design a feature like this for general use, but for your specific needs this should work fine.

<tr>.
gash's picture
Offline
Joined: 04/14/2008
Juice: 164
Re: Product Preview Brainstorming

I agree with using ajax to negotiate the image changes. The butt of the problem lies with the number of product fabric combinations. I don't think this particular client would be willing to sew all of the different possible combinations, so having images of those combinations isn't possible. I'll look into some of the php image functions and see what I can come up with.

Thanks for the input.

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Re: Product Preview Brainstorming

I didn't make it clear, but I think your idea of using an image mask for the bag which would overlay the image of the fabric was a good one, and will give you all the permutations from just 1 image per fabric + 1 image per bag. Just do it on the server side instead of showing/hiding divs on the client side.

<tr>.
gash's picture
Offline
Joined: 04/14/2008
Juice: 164
Image masks

hmm . . . I suppose I had pretty much given up on the image masks as a possibility due to png transparency problems in IE. I suppose GIFs would work fine, although I'd rather use a more open image format if possible.

TR
TR's picture
Online
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3424
Re: Image masks

You're missing my point ... do the compositing ON THE SERVER, on the fly, so the only thing you're sending to the browser is a single non-transparent PNG (or GIF or JPEG); you don't have to deal with browser differences that way. It's fast, simple and effective.

<tr>.
gash's picture
Offline
Joined: 04/14/2008
Juice: 164
Re: Re: Image masks

No, I'm picking up what you're putting down. I'm simply stating that I had given up on using my image mask idea because of the implications and limitations of client-side image rendering. I hadn't thought of doing the compositing server side, via ajax requests to a php implementation using GD (your suggestion). I think that's a wonderful idea, and I appreciate the input.

Abilnet's picture
Offline
Uber DonorBug Finder
Joined: 12/28/2007
Juice: 718
Re: Re: Re: Image masks

Interesting talking guys, subscribing. I personally see this preview feature an important one, specially from the business and usability point of view.

Well... I'm not a programmer, but generally, what do you think would be the correct path to plan an Ubercart module for this "Product Preview" -thing... or is it possible at all to have a module with preview features? (or is there any project started or work already done for this?)

gash's picture
Offline
Joined: 04/14/2008
Juice: 164
First steps

Thanks for all the input. I've been playing around with image compositing for the last few days, primarily getting comfortable with PHP image libraries. I definitely think this is the way to go -- JQuery's simplified AJAX calls coupled to a php script that composites the images. Just to play around with the idea a bit, I put together a "sample product" image composite script that pulls a random image from the product database, combines it a "frame", gives it a bit of a tilt, and displays it on the greeting page of a customer's storefront. Each time you visit the front page, you're greeted with a new pic. All in all a successful experiment -- thanks for the idea, TR.

I'll start working on the handbag product visualization stuff in the near future, as soon as I stomp all the other fires that need stomping Smiling

fourcws's picture
Offline
Cool profile pic award.
Joined: 04/16/2008
Juice: 131
Re: First steps

Impressive! - Am interested in how you did the "We Honor..." Block.

thanks,

jasom's picture
Offline
Joined: 04/13/2008
Juice: 121
Re: Product Preview Brainstorming

--
Problem with ubercart?
First:
google.com > site:ubercart.org my problem description > enter
google.com > site:drupal.org my problem description > enter

jasom.net