Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    5
    Plugin Contributions
    0

    Default Remove javascript from additional images

    How do you prevent the 'larger image' javascript from appearing under Additional Images? I'm assuming this will be a template override, but I cannot find the correct file to alter.

    thanks,

    S.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Remove javascript from additional images

    I'm trying to interpret what you're asking.

    Are you asking to remove javascript and all the popup support, or to remove the text which says "larger image"?


    Normally, the image is clickable to show a larger version via popup.
    The "larger image" text below it is part of that link.


    There are a few options, depending on your goal:

    1. The easiest is to simply remove the words "larger image":
    - edit includes/languages/YOURTEMPLATE/english.php and change
    PHP Code:
    define('TEXT_CLICK_TO_ENLARGE','larger image'); 
    to
    PHP Code:
    define('TEXT_CLICK_TO_ENLARGE',''); 
    2. If you don't want the image to be a clickable link either, you could do this instead:
    - edit includes/templates/YOURTEMPLATE/templates/tpl_modules_main_product_image.php and change
    PHP Code:
    <div id="productMainImage" class="centeredContent back">
    <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_mediumaddslashes($products_name), MEDIUM_IMAGE_WIDTHMEDIUM_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_nameMEDIUM_IMAGE_WIDTHMEDIUM_IMAGE_HEIGHT) . '<br /><span class="imgLink">' TEXT_CLICK_TO_ENLARGE '</span></a>';
    ?>
    </noscript>
    </div>
    to
    PHP Code:
    <div id="productMainImage" class="centeredContent back">
    <?php echo zen_image($products_image_medium$products_nameMEDIUM_IMAGE_WIDTHMEDIUM_IMAGE_HEIGHT); ?>
    </div>
    .

    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
    May 2006
    Posts
    5
    Plugin Contributions
    0

    Default Re: Remove javascript from additional images

    Thank you for responding. Yes, that works to remove the text 'larger image' and javascript from the Main Product Image.

    I'm also interested in removing the 'larger image' text and javascript from the Additional Images that appear under the Main Product Image. For instance, if you are displaying multiple images for a product and do not want any of these to open in a new pop up window.

    I got this to work by tweaking the file modules/additonal_images.php. However, I've had great success with Zen Cart by NOT modifying any files except those suggested in creating a new template and by adjusting settings through admin.

    Here is the test page.

    If you have any suggestions on how to do this without modifying a .php file or a better way to do it, It'd be much appreciated.

    Here is the alteration I made:

    // Link Preparation:

    CHANGED THIS:
    /*
    $script_link = '<script language="javascript" type="text/javascript"><!--' . "\n" . 'document.write(\'' . ($flag_display_large ? '<a href="javascriptopupWindow(\\\'' . $large_link . '\\\')">' . $thumb_slashes . '<br />' . TEXT_CLICK_TO_ENLARGE . '</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>';*/


    TO THIS:
    $script_link = 'Faux Fur Combo Choices:<br /><img src='.$products_image_large.' />';

    $noscript_link = '';

 

 

Similar Threads

  1. v153 Remove image popup from additional images
    By JimboGee in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 18 Jul 2015, 03:17 PM
  2. v153 How to remove javascript buy now button from homepage featured images
    By sports guy in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Jan 2015, 03:02 AM
  3. v150 Remove space from vertically aligned additional images
    By spiggles87 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Mar 2013, 12:25 PM
  4. Javascript Additional Images
    By edeades in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Jul 2009, 04:59 PM
  5. How to remove Additional Images Enlarge Link from the picture
    By XxDrAg0nxX in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 30 May 2009, 08:41 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR