Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Only show specials with images?

Only show specials with images?

Locked

Views: 833

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
15 Mar 2009, 2:54 AM
#1
dharry avatar

dharry

New Zenner

Join Date:
Feb 2009
Posts:
10
Plugin Contributions:
0

Only show specials with images?

Hi All,

On the front main pages, I want the "Monthly Specials" bot to only show procudts that have images.

Does anyone know where to change this? of what php I can add to do it?

Cheers,
Dean

15 Mar 2009, 3:01 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Only show specials with images?

Difficult to filter only ones with images...much easier for you to obtain some representative image for all products

15 Mar 2009, 3:35 AM
#3
dharry avatar

dharry

New Zenner

Join Date:
Feb 2009
Posts:
10
Plugin Contributions:
0

Re: Only show specials with images?

I thought of that, but I have 25,000 items and only 9500 of them have actual images.

I used a No Image gif, but that looked real ugly, so I turned it off...

I would have thought it would be easy to simply select only those items where products_image is null, but I cant seem to find the php program that displays the specials on the main screen.

Regards,
Dean

15 Mar 2009, 4:08 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Only show specials with images?

Peek at the module for:
/includes/modules/specials_index.php

and using your templates and overrides you can customize it to display just the products where the products_image is known ... :smile:

15 Mar 2009, 4:19 AM
#5
dharry avatar

dharry

New Zenner

Join Date:
Feb 2009
Posts:
10
Plugin Contributions:
0

Re: Only show specials with images?

Perfect!! Thanks!

For those that want the same just change the specials_index.php to the following:

$specials_index_query = "select p.products_id, p.products_image, pd.products_name, p.master_categories_id

                       from (" . TABLE_PRODUCTS . " p

                       left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id

                       left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )

                       where p.products_id = s.products_id

                       and p.products_id = pd.products_id

                       and p.products_status = '1' and s.status = 1

and p.products_image <> ''

                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
15 Mar 2009, 4:32 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Only show specials with images?

Thanks for the update and for posting the SELECT that worked for you on this ... :smile: