Forums / Upgrading from 1.3.x to 1.3.9 / New products is showing *all* products

New products is showing *all* products

Locked

Started by dbrewster on 8 Sep 2006, 3:38 PM · Views: 2,506

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
8 Sep 2006, 3:38 PM
#1
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

New products is showing *all* products

Hello again.

Working on my test site first.

The New Products listing is showing ALL products, even though:

  1. I set Admin > configuration > Maximum value > New Product Listing - Limited to ... 7 days

  2. I checked my products table and changed all the 0000-00-00 00:00:00 (artifact of EZPopulate) to 2006-01-01 00:00:00.

Still, all those products with products_date_added going back even to 2005, are showing up in New Products.

Doesn't New Products draw its list from products table, products_date_added field?

THANKS in advance!

8 Sep 2006, 4:57 PM
#2
drbyte avatar

drbyte

Sensei

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

Re: New products is showing *all* products

Yes, that's what it's supposed to do.

What version of Zen Cart ?
What addons are installed?
What version of MySQL/PHP?

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

8 Sep 2006, 5:42 PM
#3
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: New products is showing *all* products

What version of Zen Cart ?

Upgraded 1.3.0.2 --> 1.3.5

What addons are installed?

Many modifications, but none that would impact this.
Cross Sell 1.3.0, Purchase Order, USPS with handling % option, Comodo Trust (with thawte substituted), css flyout categories, MZMT, custom order motive based on order source, tax exempt, email address exporter. and a custom product type called "register" which doesn't have any special features yet.

What version of MySQL/PHP?

PHP 4.4.1
MySQL 4.0.25

**My testing website**

8 Sep 2006, 7:20 PM
#4
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: New products is showing *all* products

Reverting /includes/modules/pages/products_new/header_php.php to the previous version (1.3.0.1) fixed this problem.

Perhaps this has something to do with it:

line 19  $display_limit = zen_get_products_new_timelimit();

version 1.3.5: changed to

            $display_limit = zen_get_new_date_range();

these functions are defined in includes/functions/functions_lookups.php

9 Sep 2006, 1:06 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: New products is showing *all* products

In v1.3.5 you should have everywhere:
$display_limit = zen_get_new_date_range();

Are you sure you did not have a file out of date?

I see all lines for:

$display_limit = zen_get_products_new_timelimit();

commented out ...

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!

9 Sep 2006, 1:12 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: New products is showing *all* products

Oh good grief ... some idiot ... left in a:
return "";

before the proper return value ... :eek:

and forgot to finish the code ... gads ...

NOTE: NEW CODE 9-10-2006
Change the code to read:

// build date range for new products
  function zen_get_new_date_range($time_limit = false) {
    if ($time_limit == false) {
      $time_limit = SHOW_NEW_PRODUCTS_LIMIT;
    }

    // 120 days; 24 hours; 60 mins; 60secs
    $date_range = time() - ($time_limit * 24 * 60 * 60);
// echo 'Now:      '. date('Y-m-d') ."<br />";
// echo $time_limit . ' Days: '. date('Ymd', $date_range) ."<br />";
    $zc_new_date = date('Ymd', $date_range);
    switch (true) {
    case (SHOW_NEW_PRODUCTS_LIMIT == 0):
      $new_range = '';
      break;
    case (SHOW_NEW_PRODUCTS_LIMIT == 1):
      $zc_new_date = date('Ym', time()) . '01';
      $new_range = ' and p.products_date_added >=' . $zc_new_date;
      break;
    default:
      $new_range = ' and p.products_date_added >=' . $zc_new_date;
    }
    return $new_range;
  }

How terribly embarassing ... :blush:

Thanks for the catch ... :lamo:

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!

9 Sep 2006, 7:31 AM
#7
darkwander avatar

darkwander

Zen Follower

Join Date:
May 2005
Location:
Australia
Posts:
321
Plugin Contributions:
0

Re: New products is showing *all* products

I have the same problem, but am unsure what i am suppose to do..

// display limits
// $display_limit = zen_get_products_new_timelimit();
$display_limit = zen_get_new_date_range();

$products_new_query_raw = "SELECT p.products_id, p.products_type, pd.products_name, p.products_image, p.products_price,

That is my lines from the page
header_php.php

from directory
/public_html/shop/includes/modules/pages/products_new/

11 Sep 2006, 2:23 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: New products is showing *all* products

Check the bugfix in this thread for the New Products ...

http://www.zen-cart.com/forum/showthread.php?p=259165#post259165

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!

11 Sep 2006, 4:09 AM
#9
darkwander avatar

darkwander

Zen Follower

Join Date:
May 2005
Location:
Australia
Posts:
321
Plugin Contributions:
0

Re: New products is showing *all* products

Thanks for your help..

11 Sep 2006, 1:41 PM
#10
dbrewster avatar

dbrewster

Zen Follower

Join Date:
Jul 2005
Location:
Charlottesville, VA
Posts:
376
Plugin Contributions:
0

Re: New products is showing *all* products

Thanks for the fix, Ajeh-san!

:clap: