Results 1 to 10 of 10
  1. #1
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default force featured products to display large image rater than standard image?

    im using optimised images for my site so all of my regular images are sized to display fast on the main product listing page with the large images only showing on the actual product listing page.

    i am using featured products on the main page but i am only showing one or two at most so i would like the images to be bigger, by using the large version (_LRG) instead of the normal version.

    i cant change settings in admin>config>images because the actual size of the photos is only 150px x 150px and i need them 300px - bigger than the original is.

    ive noticed in featured_products.php the query string that calls the image is

    Code:
    $featured_products_query = "select distinct p.products_id, p.products_image, pd.products_name, p.master_categories_id
                               from (" . TABLE_PRODUCTS . " p
                               left join " . TABLE_FEATURED . " f on p.products_id = f.products_id
                               left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                               where p.products_id = f.products_id
                               and p.products_id = pd.products_id
                               and p.products_status = 1 and f.status = 1
                               and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
    what would i replace the p.products_image with to reference the large version?

    i hope ive explained my self properly?

  2. #2
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: force featured products to display large image rater than standard image?

    i really hope someone may be able to help me with this, even just a push in the right direction perhaps?

  3. #3
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: force featured products to display large image rater than standard image?

    A. you can not stretch a image larger than what it is in ZC, so if the image is 150px by 150px that is what it is.

    B. you could make the image bigger using image software then re-upload it to ZC

    C. nothing you change in the code above will stretch an image larger than it is.

    My suggestion is use a free image program to make the image 300px by 300px - upload it to ZC

    then in your stylesheet set the image width & height to 300px by 300px

  4. #4
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: force featured products to display large image rater than standard image?

    im not trying to make an image file bigger, you're right, my images are optimised at 150px x 150px, hence the reason for needing to know the reference i use in place of the regular "p.products_image" which instead of calling the database for image.jpg it will call image_LRG.jpg

    if i resize the images they will be resized for the product listing too, negating the usefulness of having optimal sized images?

  5. #5
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: force featured products to display large image rater than standard image?

    Quote Originally Posted by bonnit View Post
    i cant change settings in admin>config>images because the actual size of the photos is only 150px x 150px and i need them 300px - bigger than the original is.
    I am sorry I assumed you were trying to stretch image to be bigger than the original is.

    I am a bit lost here.

    Quote Originally Posted by bonnit View Post
    im using optimised images for my site so all of my regular images are sized to display fast on the main product listing page with the large images only showing on the actual product listing page.
    If you are using the large images on your product listing page (i think you mean product_info page) you should be able to resize image on your featured products in your .css file by adding

    #featuredDefault img {
    width:;
    height:;
    }

    you can resize up to the size of img used on product_info

  6. #6
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: force featured products to display large image rater than standard image?

    i have done that and set the values in configuration too, but like you say i can only do it up to the maximum of my normal picture size.

    in modules>featuredproducts.php it has a string where it calls the image itself

    Code:
       'text' => (($featured_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $featured_products->fields['products_image'], $featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTH, IMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . $productsInCategory[$featured_products->fields['products_id']] . '&products_id=' . $featured_products->fields['products_id']) . '">' . $featured_products->fields['products_name'] . '</a><br />' . $products_price);


    i think i need to change the portion of code thats red, ive tried adding . 'large/' . to the code just after the directory call but its just showing no image.

    so frustrating because im sure its really quite simple....

  7. #7
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: force featured products to display large image rater than standard image?

    The only way I see doing this is to hack the code for the featured product image display. I think that the image calls are in tpl_modules_products_featured_listing.php and you need to hi-jack the code for the large image and use calls similar to those found in tpl_modules_main_product_image.php.

    This is a bit more than I can do, sorry

  8. #8
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: force featured products to display large image rater than standard image?

    no problem at all, thanks for sticking with the thread :)

  9. #9
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: force featured products to display large image rater than standard image?

    just a suggestion but you could use the larger image as your default product image - shrink it on your product_info page with click to enlarge

    then by removing image value (W/H) for featured product it will display the larger image

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: force featured products to display large image rater than standard image?

    Ran across this thread in a "similar threads" list, and as there seem to be no similar threads to this with a resolution, thought I'd chime in...

    Bonnit was on the right track with the line to modify for featured products images:
    PHP Code:
      zen_image(DIR_WS_IMAGES $featured_products->fields['products_image'], $featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTHIMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT
    To use the large image instead of the base image, you would need to change both the folder path (adding large/) and the image filename (adding _LRG). The first is trivial, but the second requires inserting a string into a particular position inside another string. It would be easiest to do this ahead of time and reference the modified filename in the posted statement.
    You also really need to test for the existence of the large image, as the stock product_info page image code does. If there happens to be no large image, the zen_image function as posted would fall back on the "no image" image instead of the small image.

    /includes/modules/pages/popup_image/header_php.php holds the code for this:
    PHP Code:
      $products_image_extension substr($products_imagestrrpos($products_image'.'));
      
    $products_image_base preg_replace('|'.$products_image_extension.'$|'''$products_image);
      
    $products_image_medium $products_image_base IMAGE_SUFFIX_MEDIUM $products_image_extension;
      
    $products_image_large $products_image_base IMAGE_SUFFIX_LARGE $products_image_extension;

      
    // check for a medium image else use small
      
    if (!file_exists(DIR_WS_IMAGES 'medium/' $products_image_medium)) {
        
    $products_image_medium DIR_WS_IMAGES $products_image;
      } else {
        
    $products_image_medium DIR_WS_IMAGES 'medium/' $products_image_medium;
      }
      
    // check for a large image else use medium else use small
      
    if (!file_exists(DIR_WS_IMAGES 'large/' $products_image_large)) {
        
    $products_image_large $products_image_medium;
      } else {
        
    $products_image_large DIR_WS_IMAGES 'large/' $products_image_large;
      } 
    You would need to precede this with
    PHP Code:
    $products_image $featured_products->fields['products_image']; 
    and then use $products_image_large in zen_image():
    PHP Code:
      zen_image($products_image_large$featured_products->fields['products_name'], IMAGE_FEATURED_PRODUCTS_LISTING_WIDTHIMAGE_FEATURED_PRODUCTS_LISTING_HEIGHT

 

 

Similar Threads

  1. AJAX Image Swapper - Patch to swap between standard and AIS image display
    By jaycode in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 12 Jul 2010, 11:32 AM
  2. Large Image in Featured Product Center Box
    By EatSleepFly in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Jun 2010, 01:07 PM
  3. Display image only for Featured Products
    By cochlear in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 8 Aug 2008, 07:09 AM

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