14 replies [Last post]
duckx's picture
Offline
Cool profile pic award.
Joined: 02/28/2008
Juice: 300
Was this information Helpful?

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?

Insurrectus's picture
Offline
Spreading the word - Ubercart for president.
Joined: 08/22/2007
Juice: 364
Re: Images on products pages not clickable? .. I'm using Lightbo

URL please...

duckx's picture
Offline
Cool profile pic award.
Joined: 02/28/2008
Juice: 300
Re: Re: Images on products pages not clickable? .. I'm using Lig
kcoworks's picture
Offline
Joined: 11/22/2007
Juice: 103
Re: Re: Re: Images on products pages not clickable? .. I'm using

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?)

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Re: Re: Images on products pages not clickable? .. I'm u

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

duckx's picture
Offline
Cool profile pic award.
Joined: 02/28/2008
Juice: 300
Re: Images on products pages not clickable? .. I'm using Lightbo

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

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Re: Images on products pages not clickable? .. I'm using Lig

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.

--
Help directly fund development: Donate via PayPal!

uberuser's picture
Offline
Joined: 03/13/2008
Juice: 50
Re: Re: Re: Images on products pages not clickable? .. I'm using

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

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Sure,

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.

--
Help directly fund development: Donate via PayPal!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4110
Re: Sure,

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...

--
Help directly fund development: Donate via PayPal!

uberuser's picture
Offline
Joined: 03/13/2008
Juice: 50
Re: Re: Sure,

thank you torgosPizza that helped.

uberuser's picture
Offline
Joined: 03/13/2008
Juice: 50
Re: Re: Re: Sure,

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..

ragavendra_bn's picture
Offline
Joined: 01/10/2009
Juice: 68
Re: Re: Re: Re: Sure,
<?php print $body ?>
<?php
   
foreach ($node->field_image_cache as $field) {
?>

<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>
<?php
   
}
?>

I torgospizza. I used your code with slight modification in the directory path. It is working. How to make the thumbs a link?

THe Link --> http://jewellery.linuxflavour.co.in/node/4

ragavendra_bn's picture
Offline
Joined: 01/10/2009
Juice: 68
Resolved

No coding required I suppose...........
Lightbox2 or Thickbox modules is required
Go to admin/store/settings/products/edit/image-widgets and enable either of them. It works like crystal..........

cYu
cYu's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 11/19/2007
Juice: 850
Re: Re: Re: Re: Sure,

uberuser: Not sure how this will conflict with everything else you are trying to do, but I believe http://drupal.org/project/uc_option_image was created to handle the situation you describe above for changing t-shirt images based on attribute.