Jump to content



Photo
- - - - -

Modifying product_info.php for better fancyBox?

fancybox bxgallery pigal

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1   pfrecon

pfrecon
  • Members
  • 6 posts

Posted 26 April 2012 - 19:25

How can I change the product_info.php so that the thumbnails displayed are also links to open a fancyBox window?

I don't know why it doesn't work this way by default, it seems more intuitive. Right now you have to click the thumbnail, then click the larger image to open fancyBox. Can anyone help me change this so that it opens fancyBox when the thumb is clicked as well? I have no idea where to create the <a rel link for the thumb that the script requires.

Thanks in advance!


<script type="text/javascript">
$('#piGal ul').bxGallery({
  maxwidth: 300,
  maxheight: 200,
  thumbwidth: <?php echo (($pi_counter > 1) ? '75' : '0'); ?>,
  thumbcontainer: 300,
  load_image: 'ext/jquery/bxGallery/spinner.gif'
});
</script>
<?php
	  } else {
?>
    <div id="piGal" style="float: right;">
	  <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . 'thumbs/def/large/' . $product_info['products_image']) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'thumbs/def/display/' . $product_info['products_image'], addslashes($product_info['products_name']), null, null, 'hspace="5" vspace="5"') . '</a>'; ?>
    </div>
<?php
	  }
?>
<script type="text/javascript">
$("#piGal a[rel^='fancybox']").fancybox({
  cyclic: true
});
</script>


#2   spooks

spooks
  • Members
  • 7,017 posts

Posted 27 April 2012 - 15:00

That was the behavior of the original add-on from which the 2.3 code was 'hacked' if you examine that perhaps it will be clear

http://addons.oscommerce.com/info/7008

http://forums.oscomm...ancybox-popups/
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#3   pfrecon

pfrecon
  • Members
  • 6 posts

Posted 27 April 2012 - 16:30

I am running 2.3.1 osC. I'm not sure if your post will help, since I already have fancybox and a multi-image contrib.

Does your modified product_info.php make the thumbnails a link to fancybox popup? i.e.
<a rel="fancybox">
? That's all I'm looking for since it already functions with the main image, I'm just a noob at reading php and js /smile.png' class='bbc_emoticon' alt=':)' />

Thanks for your work and reply!