Forums / General Questions / Out of Stock/disabled items still show in NEW section

Out of Stock/disabled items still show in NEW section

Locked

Views: 5,884

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
1 Mar 2008, 6:39 PM
#1
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Out of Stock/disabled items still show in NEW section

Hi

I have disabled some products that may come back in future but they still show under the New Products for [MONTH]. When you click on them, the page displays the product not found message.

I don't want to have to delete them altogether, is there a way around this?

Regards

Dave

Proud to donate monthly

2 Mar 2008, 1:14 AM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Out of Stock/disabled items still show in NEW section

Some might call that a ... umm ... er ... bug ... :eek:

We call that an unexpected ... er ... feature ... :smartalec:

If you peek in the Known Bugs thread for v1.3.8a, you will find the solution posted ...
http://www.zen-cart.com/forum/showthread.php?p=483796#post483796

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!

2 Mar 2008, 11:16 AM
#3
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

Thanks Ajeh,

I'll remember to look in there if I find anything else.

Regards

Dave

Proud to donate monthly

23 Mar 2008, 9:57 PM
#5
rebelwax avatar

rebelwax

New Zenner

Join Date:
Nov 2006
Location:
Toronto, Ontario
Posts:
63
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

This bug only seems to happen when you click on a main category. For example...if you click on "Testing" on my left hand nav a few times you will see some items come up with no picture. These are the ones that are disabled.

http://www.miserylovesco.ca/devstore/

9 Apr 2008, 4:45 AM
#7
spinnywoman avatar

spinnywoman

Zen Follower

Join Date:
Jul 2004
Location:
Oxford
Posts:
101
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

Hi - I tried the fix (line 160) but disabled products still showing as New Product for XX Month when browsing within the relevant Category. Am using version 1.3.8a. Any advice please?

Ruth

9 Apr 2008, 12:11 PM
#8
rebelwax avatar

rebelwax

New Zenner

Join Date:
Nov 2006
Location:
Toronto, Ontario
Posts:
63
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

spinnywoman:

Hi - I tried the fix (line 160) but disabled products still showing as New Product for XX Month when browsing within the relevant Category. Am using version 1.3.8a. Any advice please?

I was having the same problem untill i realized I was reading the wrong bugfix. Here's the one that worked for me.
[
http://www.zen-cart.com/forum/showpost.php?p=483788&postcount=3](http://www.zen-cart.com/forum/showpost.php?p=483788&postcount=3)

9 Apr 2008, 8:27 PM
#9
spinnywoman avatar

spinnywoman

Zen Follower

Join Date:
Jul 2004
Location:
Oxford
Posts:
101
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

Thank you very much :-) Works a treat (I had temporarily resorted to turning this feature off via Index Listing >> Show New Products - Below Product Listing). Phew!

Ruth

15 Aug 2008, 12:12 AM
#10
wtashby avatar

wtashby

Totally Zenned

Join Date:
Feb 2006
Posts:
594
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

I've tried the bug fix and I'm still getting Out of Stock showing up in the center column New Products and the New Products side box.:blink::frusty: (see my sig below)

I Think, Therefore I Zen. I Zen, Therefore, I AM!
Personalized Flowers!
Flowertown Speaking Roses
using version 1.5.7-06232020

15 Aug 2008, 7:35 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Out of Stock/disabled items still show in NEW section

Check your code carefully ... and make sure that you do not have an override blocking your changes ...

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!

15 Aug 2008, 7:44 PM
#12
wtashby avatar

wtashby

Totally Zenned

Join Date:
Feb 2006
Posts:
594
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

Ajeh:

Check your code carefully ... and make sure that you do not have an override blocking your changes ...

Linda, I wouldn't even know where to beging to look for override changes that might effect this. I'm not even close to being anything like a coder.

I Think, Therefore I Zen. I Zen, Therefore, I AM!
Personalized Flowers!
Flowertown Speaking Roses
using version 1.5.7-06232020

15 Aug 2008, 8:09 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: Out of Stock/disabled items still show in NEW section

You said you tried to do the bug fix ... what files did you touch and where did you load them on your server?

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!

15 Aug 2008, 8:54 PM
#14
wtashby avatar

wtashby

Totally Zenned

Join Date:
Feb 2006
Posts:
594
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

Ajeh:

You said you tried to do the bug fix ... what files did you touch and where did you load them on your server?

This bug fix
http://www.zen-cart.com/forum/showpost.php?p=483788&postcount=3 and I followed your instructions to the letter.

Actually, I performed ALL the bug fixes in that thread, following both Dr. Byte's and Your instructions to the letter. But, it's the one in the link above I'm concerned about.

I Think, Therefore I Zen. I Zen, Therefore, I AM!
Personalized Flowers!
Flowertown Speaking Roses
using version 1.5.7-06232020

16 Aug 2008, 3:44 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: Out of Stock/disabled items still show in NEW section

The only thing I can think of if that fix to #3 is not working is that you have an overrides file that does not contain this fix ...

If you switch to Classic Template does it work properly?

What specific files did you touch for this fix?

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!

16 Aug 2008, 4:39 PM
#16
wtashby avatar

wtashby

Totally Zenned

Join Date:
Feb 2006
Posts:
594
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

includes/modules/new_products.php
and
includes/modules/upcoming_products.php

as instructed in the bug fix thread..

and in

includes/modules/silverfish/new_products.php
and
includes/modules/silverfish/upcoming_products.php

just to be safe.

I Think, Therefore I Zen. I Zen, Therefore, I AM!
Personalized Flowers!
Flowertown Speaking Roses
using version 1.5.7-06232020

16 Aug 2008, 4:47 PM
#17
wtashby avatar

wtashby

Totally Zenned

Join Date:
Feb 2006
Posts:
594
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

Ajeh:

If you switch to Classic Template does it work properly?

Nope, I tried, and the out of stock products still show up in both the New Products side box and New Products Center Column.

I Think, Therefore I Zen. I Zen, Therefore, I AM!
Personalized Flowers!
Flowertown Speaking Roses
using version 1.5.7-06232020

16 Aug 2008, 5:21 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Out of Stock/disabled items still show in NEW section

Could you post the code, from the server, for this file:
includes/modules/silverfish/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!

16 Aug 2008, 6:18 PM
#19
wtashby avatar

wtashby

Totally Zenned

Join Date:
Feb 2006
Posts:
594
Plugin Contributions:
0

Re: Out of Stock/disabled items still show in NEW section

<?php
/**
 * new_products.php module
 *
 * @package modules
 * @copyright Copyright 2003-2007 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: new_products.php 6424 2007-05-31 05:59:21Z ajeh $
 */
if (!defined('IS_ADMIN_FLAG')) {
  die('Illegal Access');
}

// initialize vars
$categories_products_id_list = '';
$list_of_products = '';
$new_products_query = '';

$display_limit = zen_get_new_date_range();

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

if ($new_products_query != '') $new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS);

$row = 0;
$col = 0;
$list_box_contents = array();
$title = '';

$num_products_count = ($new_products_query == '') ? 0 : $new_products->RecordCount();

// show only when 1 or more
if ($num_products_count > 0) {
  if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS == 0 ) {
    $col_width = floor(100/$num_products_count);
  } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS);
  }

  while (!$new_products->EOF) {
    $products_price = zen_get_products_display_price($new_products->fields['products_id']);
    if (!isset($productsInCategory[$new_products->fields['products_id']])) $productsInCategory[$new_products->fields['products_id']] = zen_get_generated_category_path_rev($new_products->fields['master_categories_id']);

    $list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);

    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_NEW_PRODUCTS - 1)) {
      $col = 0;
      $row ++;
    }
    $new_products->MoveNextRandom();
  }

  if ($new_products->RecordCount() > 0) {
    if (isset($new_products_category_id) && $new_products_category_id != 0) {
      $category_title = zen_get_categories_name((int)$new_products_category_id);
      $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . ($category_title != '' ? ' - ' . $category_title : '' ) . '</h2>';
    } else {
      $title = '<h2 class="centerBoxHeading">' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h2>';
    }
    $zc_show_new_products = true;
  }
}
?>

I Think, Therefore I Zen. I Zen, Therefore, I AM!
Personalized Flowers!
Flowertown Speaking Roses
using version 1.5.7-06232020

17 Aug 2008, 1:37 AM
#20
ajeh avatar

ajeh

Oba-san

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

Re: Out of Stock/disabled items still show in NEW section

What products_id are showing that should not be showing?

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!