Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Oct 2007
    Posts
    241
    Plugin Contributions
    0

    Default Additional_Images.php Line 16-display link if no large

    if (!defined('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE')) define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','Yes');

    After seeing this line, I wondered if there was a way to set Zen Cart so that the link that says ' larger image' is *ONLY* displayed when a LARGE additional image (LRG or whatever suffix & dir you have set!) is present.....

    If possible, i'd like to make it so that if there is no large photo, then there is no link for a larger image. Is it a simple setting? If so, where is it?? I looked in Admin/Images but didnt find it.

    Thank you!!!!!!!!!!!!!!!!

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

    Default Re: Additional_Images.php Line 16-display link if no large

    That's not an admin switch.

    If you want that functionality, create the following new file:

    /includes/extra_datafiles/disable_large_image_popups.php

    put this inside it:
    Code:
    <?php
    define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','No');
    // ?>
    .

    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
    Oct 2007
    Posts
    241
    Plugin Contributions
    0

    Default Re: Additional_Images.php Line 16-display link if no large

    Quote Originally Posted by DrByte View Post
    That's not an admin switch.

    If you want that functionality, create the following new file:

    /includes/extra_datafiles/disable_large_image_popups.php

    put this inside it:
    Code:
    <?php
    define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','No');
    // ?>
    Thank you, Dr. Byte!!

    That was an easy solution, though I know I wouldn't have found it on my own~!!


  4. #4
    Join Date
    Oct 2007
    Posts
    241
    Plugin Contributions
    0

    Default disable 'click 4 popup' large image when no image FOR PRODUCT LISTING (first MED file

    Quote Originally Posted by DrByte View Post
    That's not an admin switch.

    If you want that functionality, create the following new file:

    /includes/extra_datafiles/disable_large_image_popups.php

    put this inside it:
    Code:
    <?php
    define('IMAGE_ADDITIONAL_DISPLAY_LINK_EVEN_WHEN_NO_LARGE','No');
    // ?>
    It worked perfectly. Thanks for your help.

    The first product listing image (the first _MED file...NOT an additional image) still has a 'click for larger' or whatever, even when there was none. I don't know if this is a seperate thread or not....well, new title at least for my comment....lol

    How can I disable the click for larger when not present for the product listing, in the manner shown regarding the additional images?

    AND....how might I learn a LOT more about Zen Cart? Does the book cover any of this? Are there tutorials covering this stuff? Thanks.........!

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: disable 'click 4 popup' large image when no image FOR PRODUCT LISTING (first MED

    Quote Originally Posted by Donn View Post
    The first product listing image (the first _MED file...NOT an additional image) still has a 'click for larger' or whatever, even when there was none. I don't know if this is a seperate thread or not....well, new title at least for my comment....lol

    How can I disable the click for larger when not present for the product listing, in the manner shown regarding the additional images?
    When you say "product listing", are you referring to the "product information" page? or the product-listing page which lists all the products in a given category?
    .

    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.

  6. #6
    Join Date
    Oct 2007
    Posts
    241
    Plugin Contributions
    0

    Default Re: disable 'click 4 popup' large image when no image FOR PRODUCT LISTING (first MED

    Quote Originally Posted by DrByte View Post
    When you say "product listing", are you referring to the "product information" page? or the product-listing page which lists all the products in a given category?
    I have to get my terminology str8...........

    I mean the page that loads when you click on a particular product in the category or subcat listing. I meant 'prod info' i guess.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Additional_Images.php Line 16-display link if no large

    To cause the product image on the "product_info" page to not be clickable, copy the tpl_main_product_image.php template file to your custom template folder, and change these:
    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>
    to this:
    Code:
    <?php echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); ?>
    .

    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.

  8. #8
    Join Date
    Oct 2007
    Posts
    241
    Plugin Contributions
    0

    Default Re: Additional_Images.php Line 16-display link if no large

    Quote Originally Posted by DrByte View Post
    To cause the product image on the "product_info" page to not be clickable, copy the tpl_main_product_image.php template file to your custom template folder, and change these:
    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>
    to this:
    Code:
    <?php echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_IMAGE_HEIGHT); ?>
    THanks for the code........!

    Will this permit the 'click for larger' popup if the large file is present?

    Or will it disable ALL 'click for popup' links, even if there IS a large file??

    It looks like it doesn't allow for ANY clickable popups. But as I only recently started learning PHP.............I know I may be WAY off...........

  9. #9
    Join Date
    Oct 2007
    Posts
    241
    Plugin Contributions
    0

    Default Re: Additional_Images.php Line 16-display link if no large

    Quote Originally Posted by Donn View Post
    THanks for the code........!

    Will this permit the 'click for larger' popup if the large file is present?

    Or will it disable ALL 'click for popup' links, even if there IS a large file??

    It looks like it doesn't allow for ANY clickable popups. But as I only recently started learning PHP.............I know I may be WAY off...........
    OK...I changed the PHP file....

    And the clickable popup on the product description page is gone. BUT...
    That's true even when the largfe file is there. I tried changing it, but had no luck.

    Here's what i did...I took some code from the other php file alteration Dr. Byte made for the additional photos MED script......

    if (file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) {
    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>';}

    I thought this might work to display a link only when large photos exist.

    BUT...this doesnt seem to work. Am I not using the If THEN statement properly? Is this even the correct palce for it? Am I TOTALLY off?!?!

    Im clueless but Im trying!!!!!!
    Last edited by Donn; 18 Oct 2007 at 08:39 AM.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Additional_Images.php Line 16-display link if no large

    tpl_modules_main_image.php
    Code:
    <?php require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_MAIN_PRODUCT_IMAGE)); ?> 
    <div id="productMainImage" class="centeredContent back">
    
    <?php if (strstr($products_image_large, 'large/')) { ?>
    
    <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>
    
    <?php } else {
             echo zen_image($products_image_medium, $products_name, MEDIUM_IMAGE_WIDTH, MEDIUM_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.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v154 Additional_Images.php File Help
    By MCS_Computers in forum General Questions
    Replies: 19
    Last Post: 16 Jul 2015, 03:33 PM
  2. product_listing.php display large image
    By jonnyboy22 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 21 Oct 2012, 06:53 PM
  3. Replies: 5
    Last Post: 15 Sep 2011, 03:16 PM
  4. additional_images.php
    By greenlight in forum General Questions
    Replies: 1
    Last Post: 27 Sep 2008, 04:35 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