Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / Stop Disabled Products From Showing in New Products for Category?

Stop Disabled Products From Showing in New Products for Category?

Started by way10c on 9 Jan 2011, 2:27 AM · Views: 2,468

Results 1 to 11 of 11
9 Jan 2011, 2:27 AM
#1
way10c avatar

way10c

New Zenner

Join Date:
Sep 2009
Posts:
14
Plugin Contributions:
0

Post #1 by way10c

I've been setting up a music downloads category for my site and putting in the products. However, most of them are disabled until their licenses are valid. ZC still shows the disabled products in the New Products for >month< area. How do I fix that? It will frustrate the customers.

Thanks,

--Allen

13 Mar 2011, 4:14 PM
#3
bigdiogi avatar

bigdiogi

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
0

Post #3 by bigdiogi

Read the other threads I could find regarding this issue. Am using v1.3.9, read several places this was a known issue in 1.3.8. Had already ensured that -

Config>Stock>Products status in Catalog when out of stock should be set to =0

Which should prevent out of stock and disabled products from EVER showing, correct?

What'd I miss this time?

Fine Handcrafted Boxes & Custom Woodworking
[email protected]
http://www.phoenixwoodworks.net

13 Mar 2011, 4:46 PM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

Check that the file:
/includes/modules/new_products.php

is current and up to date and includes the reference to the products_status = 1

in both of the SELECT statements ...

Note: you may have a template and override file in:
/includes/modules/your_template_dir/new_products.php

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!

13 Mar 2011, 5:41 PM
#5
bigdiogi avatar

bigdiogi

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
0

Post #5 by bigdiogi

Ajeh:

Check that the file:
/includes/modules/new_products.php

is current and up to date ... Note: you may have a template and override file in:
/includes/modules/your_template_dir/new_products.php

Clean, new install of latest version, why would it not be current? No other version present in template overide directory.

Version info is " * @version $Id: new_products.php 6424 2007-05-31 05:59:21Z ajeh $"

and includes the reference to the products_status = 1

in both of the SELECT statements ...

Here is the 2nd SELECT statement - ```
$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 . ")";


The first SELECT statement has this line at the end - ```
and   p.products_status = 1 " . $display_limit;

Forgive my overwhelming ignorance, but should I just add that to the second statement as well. Cut and past after the final line? Obviously, I'm once again in WAY over my head. Don't want to screw things up trying to solve a fairly minor annoyance.

Thanks for your help and your patience.

Fine Handcrafted Boxes & Custom Woodworking
[email protected]
http://www.phoenixwoodworks.net

13 Mar 2011, 6:44 PM
#6
ajeh avatar

ajeh

Oba-san

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

Post #6 by ajeh

Compare the original code from:
/includes/modules/new_products.php

with your templates and overrides:
/includes/modules/your_template_dir/new_products.php

Do they both have the products_status = 1 in both SELECT statements?

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!

13 Mar 2011, 7:10 PM
#7
bigdiogi avatar

bigdiogi

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
0

Post #7 by bigdiogi

Ajeh:

Compare the original code from:
/includes/modules/new_products.php

with your templates and overrides:
/includes/modules/your_template_dir/new_products.php

Do they both have the products_status = 1 in both SELECT statements?

Thought I answered both of these questions in my earlier reply.

There IS no second version of the file in /includes/modules/my_template_dir/new_products.php

File is ONLY located in default template location.

There is no products_status = 1 in the second SELECT statement. So how do I remedy that? Do I insert it? How so do I do that without messing up the syntax of the query?

Keep in mind I am totally ignorant about php and SQL languages.

Fine Handcrafted Boxes & Custom Woodworking
[email protected]
http://www.phoenixwoodworks.net

13 Mar 2011, 7:21 PM
#8
bigdiogi avatar

bigdiogi

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
0

Post #8 by bigdiogi

Always try to keep my posts concise, Perhaps that sometimes makes them unnecessarily cryptic. Here are the lines of code I believe you are referring to -

if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
  $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 " . $display_limit;
} else {
  // get all products and cPaths in this subcat tree
  $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);

  if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
    // build products-list string to insert into SQL query
    foreach($productsInCategory as $key => $value) {
      $list_of_products .= $key . ', ';
    }
    $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma

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

If I'm following you correctly, I need to add a reference to p.products_status = 1 " to the end of the second SELECT query. Exactly how should I do that? What is the correct syntax? Should I just copy and paste ```
and p.products_status = 1 " . $display_limit;

before the } ?

Fine Handcrafted Boxes & Custom Woodworking
[email protected]
http://www.phoenixwoodworks.net

14 Mar 2011, 12:49 AM
#9
ajeh avatar

ajeh

Oba-san

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

Post #9 by ajeh

You have me confused ...

In v1.3.9h the version id reads:

 * @version $Id: new_products.php 8730 2008-06-28 01:31:22Z drbyte $

yet you say you are using v1.3.9h and not v1.3.8 yet you are showing the code for v1.3.8 ... :unsure:

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!

14 Mar 2011, 2:15 AM
#10
bigdiogi avatar

bigdiogi

New Zenner

Join Date:
Jan 2009
Posts:
59
Plugin Contributions:
0

Post #10 by bigdiogi

Well, that makes two of us that are confused . Downloaded zen-cart-v1.3.9h-full-fileset-10262010.zip on 2/05/2011. Just checked that, still have the zip file. Extracted the archive. It's the only copy of zencart on a fairly new laptop with no clutter or old files laying around. Installed as per directions. But when I just checked version info in admin, shows Zen Cart 1.3.8a.

How in the XXX?! I've been operating under the delusion that I actually installed the version I downloaded. POLTERGEIST!

'Splains the issue though, huh? A known bug in 1.3.8.

Fine Handcrafted Boxes & Custom Woodworking
[email protected]
http://www.phoenixwoodworks.net

14 Mar 2011, 2:52 AM
#11
ajeh avatar

ajeh

Oba-san

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

Post #11 by ajeh

Hate when the gremlins strike ... :eek:

I would redo the site with v1.3.9h before you get much further as that v1.3.8 is very old and very buggy and has a lot of security issues that were addressed in v1.3.9 ...

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!