Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Nov 2010
    Posts
    52
    Plugin Contributions
    0

    Default Only display products with images.

    is it possible to only display products on the main page that have a product image(s)?

    EG...I have a few products with a "default" image that is used if no product image is available. I think the site looks tacky and unprofessional if there are a bunch of "default" images instead of only products with product images.

    I am using v1.3.9h

    Listing items of a category with no product imag is fine...I just don't want them showing up on the main page.

    Any help would be awesome.

  2. #2
    Join Date
    Nov 2010
    Posts
    52
    Plugin Contributions
    0

    Default Only display products with images.

    Is it possible to only display products on the main page that have a product image(s)?

    EG...I have a few products with a "default" image that is used if no product image is available. I think the site looks tacky and unprofessional if there are a bunch of "default" images instead of only products with product images.

    I am using v1.3.9h

    Listing items of a category with no product imag is fine...I just don't want them showing up on the main page.

    Any help would be awesome.

    NOTE TO MODS
    This is a double post please delete my original post from "Setting Up Categories, Products, Attributes"

  3. #3
    Join Date
    Nov 2010
    Posts
    52
    Plugin Contributions
    0

    Default Re: Only display products with images.

    I am 99% sure I will end up stumping almost everyone with this question. This is definitely a question for a programmer.

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

    Default Re: Only display products with images.

    In /includes/index_filters/default_filter.php, find the four statements beginning with
    PHP Code:
          $listing_sql "select " $select_column_list "... 
    Add after the line
    PHP Code:
            where p.products_status 
    a new line
    PHP Code:
              and p.products_image != '' 
    This will exclude products without assigned images from product listings. If you want to extend this functionality to other product types than product-general, edit the appropriate filter file.

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

    Default Re: Only display products with images.

    The above will affect all product listing pages. If you want to affect only the home page category listing (when you have a specific category open on the home page), it will need some tweaking. If you want to affect centerboxes rather than listings on the home page, a different filter would most likely need to be edited. Where exactly do you want this functionality?

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Only display products with images.

    On these Products, is the products_image actually blank?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Nov 2010
    Posts
    52
    Plugin Contributions
    0

    Default Re: Only display products with images.

    Quote Originally Posted by Ajeh View Post
    On these Products, is the products_image actually blank?
    No ...I have a default image for products with no image(s) called no-image.gif. I will eventually be getting images for the products without them but in the interim would like to NOT have products with no image(s) be visible on the main page.

    As you can see; the vast majority of the products with no images are specific species of fish....it is difficult to find good quality of images of these fish because some of them are rare or images are not available through the image sites I belong to eg: http://www.123rf.com/.

    Check out the site at http://oceanabyssaquatics.ca/store/

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Only display products with images.

    If you have actually entered a specific image name in the products table for the field:
    products_image

    you could test for that and not show those products by customizing the SELECT statements in the files where you do not want these to show ...

    If this is only on the main page, you can customize things further with the variable:
    $this_is_home_page

    which will be true when on the Home page ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  9. #9
    Join Date
    Nov 2010
    Posts
    52
    Plugin Contributions
    0

    Default Re: Only display products with images.

    Quote Originally Posted by Ajeh View Post
    If you have actually entered a specific image name in the products table for the field:
    products_image

    you could test for that and not show those products by customizing the SELECT statements in the files where you do not want these to show ...

    If this is only on the main page, you can customize things further with the variable:
    $this_is_home_page

    which will be true when on the Home page ...
    You kinda lost me...sorry. What I mean is...by default Zencart uses the no_picture.gif file for products with no image. I simply replaced that image with my own...you can see it below:



    Now; I'm fluent in HTML and CSS... not so much in php. Therefore if you are going to make a programming suggestion kindly point me to the file to edit as well as the appropriate code and where to put it.

    Thanks again for your patience with my ignorance.

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

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Problem with attributes set with Display Only
    By canemasters in forum Setting Up Categories, Products, Attributes
    Replies: 13
    Last Post: 4 Apr 2012, 11:02 PM
  2. Display Products When Only 1 SubCategory?
    By WellCool in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 21 Apr 2009, 08:54 AM
  3. will only display 22 new products
    By traciboyle in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Oct 2008, 07:07 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