Zen Cart Logo
Forums / Bug Reports / [Done v1.4.0] Admin Category Product Status

[Done v1.4.0] Admin Category Product Status

Locked

Views: 4,823

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
31 Dec 2007, 1:25 AM
#1
sweet_zouzou avatar

sweet_zouzou

Zen Follower

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

[Done v1.4.0] Admin Category Product Status

I'm having a problem with my admin category/product status control. I can set the status to "off" or "on" in the admin and get the red or green button, but the links still show up on the site when set to "off". I am sure one of the numerous mods I have installed has messed this up, but could use some direction on which file(s) to restore or compare from my backup files.

Thx Sweet

31 Dec 2007, 2:26 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.4.0] Admin Category Product Status

There appears ti ve a bug in two of the center boxes ...

/includes/modules/new_products.php

This section around lines 40-45

    $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 . ")";

Needs to be updated to:

    $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_status = 1
                           and p.products_id in (" . $list_of_products . ")";

And then in the:
/includes/modules/upcoming_products.php

around lines 43 to 50

    $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                       where p.products_id = pd.products_id
                       and p.products_id in (" . $list_of_products . ")
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
                       $display_limit .
                       $limit_clause;

to read:

    $expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected, p.master_categories_id
                       from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                       where p.products_id = pd.products_id
                       and p.products_status = 1
                       and p.products_id in (" . $list_of_products . ")
                       and pd.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
                       $display_limit .
                       $limit_clause;
31 Dec 2007, 2:27 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.4.0] Admin Category Product Status

Moving to Bug Report ...

31 Dec 2007, 3:42 AM
#4
sweet_zouzou avatar

sweet_zouzou

Zen Follower

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

Re: [Done v1.4.0] Admin Category Product Status

Thanks for the quick reply Linda. I will apply your suggestion and post back to this thread with my status.

Sweet

31 Dec 2007, 4:43 PM
#5
sweet_zouzou avatar

sweet_zouzou

Zen Follower

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

Re: [Done v1.4.0] Admin Category Product Status

I can't find that exact code in my files. I have installed several category listing mods that have modified this section of code. However, the missing code "and p.products_status = 1" seems to be in both files as shown below.

/includes/modules/new_products.php

} else {
$new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, p.products_date_added,
p.products_price
from " . TABLE_PRODUCTS . " p
left join " . TABLE_SPECIALS . " s
on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
TABLE_CATEGORIES . " c
where p.products_id = p2c.products_id
and p2c.categories_id = c.categories_id
and c.parent_id = '" . (int)$new_products_category_id . "'
and p.products_status = 1 " . $display_limit;
}

/includes/modules/new_products.php

$expected_query = "select p.products_id, pd.products_name, products_date_available as date_expected
                   from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " .
                          TABLE_CATEGORIES . " c
                   where p.products_id = p2c.products_id
                   and p2c.categories_id = c.categories_id
                   and c.parent_id = '" . (int)$new_products_category_id . "'" .
                   $display_limit . "
                   and p.products_id = pd.products_id
                   and p.products_status = 1
                   and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                   order by " . EXPECTED_PRODUCTS_FIELD . " " . EXPECTED_PRODUCTS_SORT . "
                   limit " . MAX_DISPLAY_UPCOMING_PRODUCTS;

}

Sweet

13 Dec 2008, 2:37 PM
#6
stride_r avatar

stride_r

Zen Follower

Join Date:
Aug 2008
Posts:
115
Plugin Contributions:
0

Re: [Done v1.4.0] Admin Category Product Status

There appears to be a bug in two of the center boxes ...

This simple bug was noticed in Dec '07 , the solution is a terrific and easy fix ...but i wonder why this wasn't just plugged into the current 1.3.8 download files when it was first found - so that people who download their copies from that point forward wouldn't all have to go through the same steps in finding fixing their carts?

I really like ZenCart but I'm not sure i understand the project sometimes. :blink:

13 Dec 2008, 5:10 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.4.0] Admin Category Product Status

Cause I goofed ... :blush:

Sometimes, we actually goof in coding thousands of lines of code in each of the Free Releases that we make and sometime we actually moof it up from time to time when writing all of the neat, free code for you to run your online business ... you might also note it was caught shortly after the release date too ...

I heard a rumor the other day that all of us on the Zen Cart Development Team are ... are ... are ... human ... :eek:

go figure? :cool:

NOTE: go here and play ...
http://www.zen-cart.com/forum/showthread.php?t=82619

13 Dec 2008, 5:42 PM
#8
stride_r avatar

stride_r

Zen Follower

Join Date:
Aug 2008
Posts:
115
Plugin Contributions:
0

Re: [Done v1.4.0] Admin Category Product Status

Ajeh,

No, Sorry - of course we are all human - and i apologize if my comment came off wrong. Lord knows I make more mistakes than most!

The Zen project is a wonderful venture and I owe you guys much ...but when i read "[Done v1.4.0]" in the title line but didn't see it applied to current 1.3.8 , I thought that there was some reason - one that i didn't understand. Sorry. :blush:

Thanks again!

13 Dec 2008, 5:53 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: [Done v1.4.0] Admin Category Product Status

The bug snuck in the v1.3.8 version ... hence, it's in there ... :blink:

But the fixes are posted on the Known Bug Fixes for v1.3.8 and here ... :smile:

17 Jan 2009, 5:37 AM
#10
cherven avatar

cherven

New Zenner

Join Date:
Dec 2008
Location:
Saratoga Springs, NY
Posts:
25
Plugin Contributions:
0

Re: [Done v1.4.0] Admin Category Product Status

I think i just found another bug in the new_products module...

On my website, in the center box for new products, if a product is in category_id (cPath) 1, then the link it generates links it as cPath=0

Here is an example:

This is one of the links from the center new products box, from a product from cPath 1, when i click on it, it displays as cPath=0...

http://www.slotmachinesdirect.com/index.php?main_page=product_info&cPath=0&products_id=61

However, if the product is in a cPath other than 1, it displays just fine, so im not sure what the cause of this is.

Anyone have any idea where this little bug is located?

17 Jan 2009, 5:39 AM
#11
cherven avatar

cherven

New Zenner

Join Date:
Dec 2008
Location:
Saratoga Springs, NY
Posts:
25
Plugin Contributions:
0

Re: [Done v1.4.0] Admin Category Product Status

Note: it also happens on the "new products" sidebox as well...

Feel free to look at my website, and click around to see what i mean:

http://www.slotmachinesdirect.com/

17 Jan 2009, 5:46 AM
#12
cherven avatar

cherven

New Zenner

Join Date:
Dec 2008
Location:
Saratoga Springs, NY
Posts:
25
Plugin Contributions:
0

Re: [Done v1.4.0] Admin Category Product Status

Update:

This problem seems to be random, it works fine on some cPaths, and others it dont... its not just cPath 1, it happens on others as well...