Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / Products from disabled categories show up in New Products on home page.

Products from disabled categories show up in New Products on home page.

Locked

Started by peppyone on 4 Aug 2007, 1:22 PM · Views: 5,019

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
4 Aug 2007, 1:22 PM
#1
peppyone avatar

peppyone

New Zenner

Join Date:
Dec 2004
Posts:
37
Plugin Contributions:
0

Post #1 by peppyone

I have several Categories that I have disabled (status off). Each category has hundreds of products. I need to re-categorized these products but in the meantime those products are showing up in the "New Products for August" on my home page.

How can I suppress those products? I thought I was doing that by inactivating the category.

29 Dec 2007, 2:55 AM
#2
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Post #2 by juicevb10

Yeah, me too.

There is probably an easy answer to this. Disabled Status should keep the product from displaying everywhere on the front end....shouldn't it?

Anyone?

29 Dec 2007, 3:07 AM
#3
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Post #3 by juicevb10

I mean...I have disabled Products (not categories) that are showing up under new products.

29 Dec 2007, 5:27 AM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

What version of Zen Cart are you running?

Clean install or an Upgrade?

Have you an URL where we can see this?

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!

29 Dec 2007, 11:42 PM
#5
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Post #5 by juicevb10

1.3.8
Clean Install
Site
Ami, Evie, Chloe, Antoinette, etc...the ugly pictures....are the disabled products. They don't show up on normal category listings.

30 Dec 2007, 12:25 AM
#6
ajeh avatar

ajeh

Oba-san

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

Post #6 by ajeh

Your site appears to be down at the moment ...

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!

30 Dec 2007, 3:16 AM
#7
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Post #7 by juicevb10

Hmmm...Sorry...Try this link
Actually, I don't have new items enabled either...I was messing with categories at the same time.
It'll be up shortly.

30 Dec 2007, 3:26 AM
#8
juicevb10 avatar

juicevb10

New Zenner

Join Date:
Nov 2007
Posts:
30
Plugin Contributions:
0

Post #8 by juicevb10

Actually, it doesn't seem to be doing it anymore. All I did was change a category name and move the items up a level on my category tree. If I can reproduce the problem again, I'll re-post.

Thanks for looking, and I apologize for any inconvenience.

Is there anyway to eliminate dead-end threads like this from the forum?

30 Dec 2007, 4:43 AM
#9
ajeh avatar

ajeh

Oba-san

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

Post #9 by ajeh

Nope ... never know when someone might learn something from it ... :smile:

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!

22 Jun 2008, 7:39 PM
#10
azzxxxc avatar

azzxxxc

New Zenner

Join Date:
Jun 2008
Posts:
6
Plugin Contributions:
0

Post #10 by azzxxxc

(crap... I hit "submit" and it asked me to login and then didn't work... so my appologies if this is a double post)

I had this same problem... I have products that come out later in the year, but are showing up in the "new products for" this month area of the page.

I tried disabling the products and got this result:
--no they don't show on the category page (correct)
--still show in the "new products for this month" area (incorrect)
--and show in the "Upcoming Products" area (correct... I guess... though I did disable them... so even tho I like this functionality... it seems a little wrong for disabled products to be displaying anywhere, ever... plus when I click on these products, it brings me to a "Sorry, the product was not found." page.)

maybe I don't quite understand what zen cart's current definition of "disabled" means... I thought it meant "keep it in the data base, but don't display it ever"

I'm great with php, but new to mySQL... I found includes/modules/new_products.php and the following line (line 40 for me... in the 'else' statment):

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_id in (" . $list_of_products . ")";
  }

I changed it to:

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, [B]products_status, [/B]p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           [B]and p.products_status = 1[/B]
                           and p.products_id in (" . $list_of_products . ")";
  }

it works as far as not displaying the disabled products in the "New Products for this month" area... but it's not the right answer (because my products are disabled... so when you click on them in the "Up coming products" area of a page, you go to a "Sorry, the product was not found." page.

SO IF YOU KNOW MYSQL, can you help me out with the query command above... rather than the products_status stuff I added... I like to add a
"products_date_available" and check if it's ">= today".... checking "p.product_status = 1" was easy.... but I don't know the mySQL syntax for ">= today"....

Thanks.

also, I'm still very knew to the whole open source environment... It seems to me that the logic in this file is a little off... instead of listing "products added this month"... it seems like it should display "products that are added this month and don't have any available data as well as products that are available this month (and were added months ago)" ... I don't even know where I'd begin to get the communities clearance to attempt to change this logic and then submit it, etc...

Thanks again,
~Danny

22 Jun 2008, 10:03 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #11 by drbyte

Some related articles:

  1. What determines "New" for centerboxes: https://www.zen-cart.com/tutorials/index.php?article=3

  2. Known bug, with fix, for disabled items showing unexpectedly: http://www.zen-cart.com/forum/showthread.php?p=483788#post483788

.
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.

23 Jun 2008, 6:20 PM
#12
azzxxxc avatar

azzxxxc

New Zenner

Join Date:
Jun 2008
Posts:
6
Plugin Contributions:
0

Post #12 by azzxxxc

thanks for the links.

I just got it to do exactly what I wanted, which was, "don't display if disabled" and "don't display if it's not available yet"

before

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_id in (" . $list_of_products . ")";

after

    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                  p.products_date_added, p.products_status, p.products_date_available, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_status = 1
                           and ((p.products_date_available IS NULL) or (p.products_date_available < CURDATE()))
                           and p.products_id in (" . $list_of_products . ")";

however.... I foresee a problem... if I added the product this month and it comes out 2 months from now... this solution will work and the product will not be shown this month... however, 2 months later I'm not sure if it will display in the "new products for month" area like it should...