Author Topic: "Lightbox" with browse_x.php/pricelist  (Read 3089 times)

nkamp

  • Jr. Member
  • **
  • Posts: 67
"Lightbox" with browse_x.php/pricelist
« on: May 16, 2010, 14:54:01 pm »
Hello,

I have seen this topic already mentioned many times before but I do not understand everything.

I have changed flypagetpl.php with more or less 'child products' with the table 'jos_vm_product_relations'. The child products are not on the browse page but they are on the flypage.
To show the childproduct picture with lightbox, I have done this by the next line:
Code: [Select]
$Related_product = $Related_product.'<td align="center" width="100"><a href="'.$Related_product_image.'" title="'.$Related_name.'" rel="lightbox[product'.$Related_product_id.']"><img src="'.$Related_product_image.'" border="0" width="100" height="100" style="cursor: hand; border: 0;" /></td>';

This works fine. No problem at all.

So I thought it can not be difficult to do more or less the same on the browse page and add such a line like this. Maybe I only have to include something or... But it doesn´t work.

I want to develop a pricelist as well. And after each price in the pricelist I want to add thumb of the picture and use lightbox.

I have seen some of the topics. Then there is a reaction with the ´SOLUTION´ but the next reaction is then it is not working... I simply want the same on the browse page like the flypage.

Now my questions/points or problems:
- To show on the browse_x.php page simply a picture with lightbox like on the flypage.tpl.php what do I have to do? Because I'm simply thinking there is not so much difference between the browse and the flypage page, or...?

-Do I have to install the complete code of Mark Callf? Because I think have to use this when you have more then one picture of product or am I wrong?
I´ve been looking on the site of Mark but I can not find the tutorial or to find how to implement this en when you want to use this (because I think this depends on what you want). But this could also be my fault that I´m not good looking/searching of I'm thinking to difficult.

I hope that somebody can help me.

Thnaks in advance.

Nico


rb

  • Advanced
  • Full Member
  • *****
  • Posts: 1503
Re: "Lightbox" with browse_x.php/pricelist
« Reply #1 on: May 16, 2010, 22:44:43 pm »
To enable a browse_x page to show the full size image in a lightbox when the thumbnail is clicked, first make a copy of your browse_x file.

Find the existing link which shows the thumbnail, often something like this:

Code: [Select]
    <a href="<?php echo $product_flypage ?>">
          <?php echo ps_product::image_tag$product_thumb_image'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ?>
       </a>

Replace it with this:

Code: [Select]
  <?php // rb add to show lightbox on browse page
$product_thumb_image_url = IMAGEURL.'product/'.$product_thumb_image;
if( strpos( $product_thumb_image, 'http://' ) === 0 ) {
$product_thumb_image_url = $product_thumb_image;
}
   echo vmCommonHTML::getLightboxImageLink( $product_full_image, '<img src="'.$product_thumb_image_url.'" />', $product_name );
  ?>


Save and test.

nkamp

  • Jr. Member
  • **
  • Posts: 67
Re: "Lightbox" with browse_x.php/pricelist
« Reply #2 on: May 17, 2010, 20:34:27 pm »
Hello rb,

This looks good. This just where I was looking for. I don't understand why all the other topics with same problem about browse_x.php are talking about index adding a line in the index page
Code: [Select]
<?php JHTML::_('behavior.modal'); ?>

http://forum.virtuemart.net/index.php?topic=52989.msg202905

etc. etc.

But anyway thanks a lot.
And I will investigate when I need that from Mark Calff.

Nico

k2bmedia

  • Beginner
  • *
  • Posts: 5
Re: "Lightbox" with browse_x.php/pricelist
« Reply #3 on: June 23, 2010, 13:37:08 pm »
Thank you verry much, The modification is only available on browse_2.php and browse_5.php

I used browse_1.php and made the following modification;

search the following code:

Code: [Select]
<script type="text/javascript">//<![CDATA[
        document.write('<a href="javascript:void window.open(\'<?php echo $product_full_image ?>\', \'win2\', \'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=<?php echo $full_image_width ?>,height=<?php echo $full_image_height ?>,directories=no,location=no\');">');
        document.write( '<?php echo ps_product::image_tag$product_thumb_image'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ?></a>' );
        //]]>
        </script>
        <noscript>
            <a href="<?php echo $product_full_image ?>" target="_blank" title="<?php echo $product_name ?>">
            <?php echo ps_product::image_tag$product_thumb_image'class="browseProductImage" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ?>
            </a>
        </noscript>

Replace with the code of rb:

Code: [Select]
  <?php // rb add to show lightbox on browse page
$product_thumb_image_url = IMAGEURL.'product/'.$product_thumb_image;
if( strpos( $product_thumb_image, 'http://' ) === 0 ) {
$product_thumb_image_url = $product_thumb_image;
}
   echo vmCommonHTML::getLightboxImageLink( $product_full_image, '<img src="'.$product_thumb_image_url.'" />', $product_name );
  ?>




nkamp

  • Jr. Member
  • **
  • Posts: 67