Images on products pages not clickable? .. I'm using Lightbox module Could this is be why?

Posts: 4
Joined: 02/28/2008

hey fellow ubercarters...

My Images on products pages not clickable? .. I'm using Lightbox module Could this is be why? I didnt install thickbox since they said there might be some conflicts. The only thing i see is the thumbnail on the product pages. I cant get the full blown up size. Anyone had a similar problem?

Posts: 118
Joined: 08/22/2007
Spreading the word - Ubercart for president.

URL please...

Posts: 4
Joined: 02/28/2008
Posts: 46
Joined: 11/22/2007

We used Lightboxv2... Does lightbox require the jquery_update, and if so, did you update the jquery script? (moved the file after installing the update mod?)

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

Keep in mind that the clickable images are a function of Thickbox, so you'll have to edit your product templates to use Lightbox links. I haven't used the module, so I can't tell you how it's done... Puzzled

Posts: 4
Joined: 02/28/2008

do you guys have a sample site that isnt all too decorated so i can get an idea of how it can look?

Posts: 1123
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Here's how I did it. The main thing is to include the class="thickbox" attribute.

<a href="/<?php print $field['filepath'];?>" class="thickbox" rel="field_image_cache_0" alt="<?php print $field['filename']; ?>" title="<?php print $field['filename']; ?>"><?php if($field['filepath'] == $field_image_cache[0]['filepath']) print '<img src="/files/imagecache/product/'.$field['filepath'].'" title="'.$field['filename'].'" alt="'.$field['filename'].'">'; ?></a>

I used the fields from Contemplate to populate the link, that way your Alt tags and href Title uses whatever value you've got for a filename. You could change this up to include the node title if you want (using $node->nid).

Hope this helps.

For an example check out something from our catalogue: http://shop.rifftrax.com/rifftrax/jurassic-park (click on the poster to get the large version). I also have multiple images on some products (go to Gift Shop > Apparel > Logo T-shirt and check that out): http://shop.rifftrax.com/apparel/logo-t-shirt ... and that's done by using a foreach loop.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 23
Joined: 03/13/2008

torgosPizza, I like your site rifftrax.com great work!! Could you tell me how to achieve the multiple images for a single product I would like to get add that functionality, I saw where you had a snippet above but not sure where to put it in.

thanks

Posts: 1123
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Thanks, glad you like the site Smiling

I used the Contemplate module to create a product template, or you could use node-product.tpl.php, I think. Here's the complete code with foreach loop - assuming you are using CCK to add your images (and have "Multiple" selected in your field's config).

<?php
   
foreach ($node->field_image_cache as $field) {
?>

<a href="/files/imagecache/thickbox/<?php print $field['filepath'];?>" class="thickbox" rel="field_image_cache_0" alt="<?php print $field['filename']; ?>" title="<?php print $field['filename']; ?>"><?php if($field['filepath'] == $field_image_cache[0]['filepath']) print '<img src="/files/imagecache/product/'.$field['filepath'].'" title="'.$field['filename'].'" alt="'.$field['filename'].'">'; ?></a>
<?php
   
}
?>

My only note is that, for portability sake, you might want to swap the "/files/imagecache" etc hard-coded directory locations for a dynamic base_path() and $field['filepath'] construction. I just haven't gotten around to revisiting my code yet Smiling (I would also change the Alt and Title tags to be whatever was specified in the image cache fields, if you have that configured.

So what this loop does, is goes through all of the attached files for that node, and checks if it's the first image ($field_image_cache[0]['filepath']).. If so, it prints that one large and hides all of the other ones, but adds them as elements in the Thickbox array. I can't remember how I figured it out exactly but when you have other links that include the "thickbox" class, it will include them all in the "slides" type presentation you see on our T-shirt product page.

Hope this helps! Feel free to tweak and modify to your heart's content.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 1123
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

I also noticed mykz's awesome tutorial for styling product pages, which appears to use code very similar to mine, you can check it out here:

http://www.ubercart.org/forum/development/3868/nifty_products_tutorial_p...

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com

Posts: 23
Joined: 03/13/2008

thank you torgosPizza that helped.

Posts: 23
Joined: 03/13/2008

torgosPizza, Could you tell me how can i achieve displaying a different image every time the product attributes are changed? For example I want to show the red t-shirt if red attribute is selected and blue, etc..