Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2006
    Posts
    67
    Plugin Contributions
    0

    Default Removing Popup Windows

    Hello all,

    I've been trying to find a way to remove the traditional popup windows from my product info pages.

    I have Image Handler installed and it seems a little redundant to have an image that displays on mouseover and the same image displayed in a popup window. I would rather have the Image Handler hover effect as it looks much nicer.

    I tried removing the tags from 'addtional_images.php' but ZenCart didn't seem too happy about that!

    Anyone have experience removing the appropiate chunk of code?

    Cheers

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Removing Popup Windows

    includes/templates/YOURTEMPLATE/templates/tpl_modules_main_product-image.php
    remove the <script..../script>content, and the <noscript> tag, and the closing </noscript> tag, leaving the content between the noscript tags.
    Then edit to remove the words that say to click for larger image.
    Then remove the A HREF if you don't want it clickable.
    Code:
    <script language="javascript" type="text/javascript"><!--
    document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '\\\')">' . zen_image($products_image_medium, addslashes($products_name), MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>'; ?>');
    //--></script>
    <noscript>
    <?php
      echo '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $_GET['products_id']) . '" target="_blank">' . zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' . TEXT_CLICK_TO_ENLARGE . '</span></a>';
    ?>
    </noscript>
    becomes
    Code:
    <?php
      echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT);
    ?>
    Do similarly for additional-images file.

    You may have to do some styling adjustments after making this change if the image doesn't appear as desired.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2006
    Posts
    67
    Plugin Contributions
    0

    Default Re: Removing Popup Windows

    Hi DrByte,

    Thanks for taking a look at this, I would have tried it out sooner, but I was at work.

    Sorry, I should have been more detailed. I took care of the popup on the large image earlier (by doing exactly what you mentioned in your reply), however, I'm trying to remove the popup on the thumbnails.

    The code that generates the links seems to be residing in 'additional_images.php' and looks like this

    Code:
     $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '</a>' : $thumb_slashes) . '\');' . "\n" . '//--></script>';
    
        $noscript_link = '<noscript>' . ($flag_display_large ? '<a href="' . zen_href_link(FILENAME_POPUP_IMAGE_ADDITIONAL, 'pID=' . $_GET['products_id'] . '&pic=' . $i . '&products_image_large_additional=' . $products_image_large) . '" target="_blank">' . $thumb_regular . '<br />' . TEXT_CLICK_TO_ENLARGE . '</a>' : $thumb_regular ) . '</noscript>';
    I made a change, to this:

    Code:
     $script_link = ($flag_display_large ? '<a href="javascript:popupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '</a>' : $thumb_slashes);
    That took my popup and my hover away. Any ideas?

    Cheers,

    Colin

  4. #4
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: Removing Popup Windows

    Thanks Dr. Byte..

    Aloha

    Rafa

  5. #5
    Join Date
    Apr 2007
    Location
    Sydney
    Posts
    109
    Plugin Contributions
    0

    Default Re: Removing Popup Windows

    Quote Originally Posted by Radish View Post
    Any ideas?
    Colin's probably got it sorted out by now, but I encountered a similar problem (I need to get the additional images to display as they are without popups or thumbnails, like how they do it on eBay), and luckily I found the solution from this other thead provided by twitchyLegs:

    http://www.zen-cart.com/forum/showth...itional+images

    twitchyLegs modified the script link and blanked the noscript link, I've done the opposite to get consistent with Dr Byte's approach to the main product image. I'm not a php coder so I don't know if there is any practical difference.

    In short, go to includes\modules\additional_images.php, replace all the codes in the Link Preparation section, with the following line:

    $noscript_link = '<img src='.$products_image_large.' />';

    That's it, less clicks for customers before they hit the buy button. So happy to get this done!

 

 

Similar Threads

  1. Popup Windows in EZPages
    By tiger in forum General Questions
    Replies: 0
    Last Post: 4 Jun 2007, 03:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg