Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

products_new.php


rothjoseph

Recommended Posts

Posted

Hello,

 

I was wondering if it is possible to limit the amount of new products that are displayed on the products_new.php page to 30 items.

 

Currently it lists 10 items per page and as far as I know it will list as many items as I have in my store. I want to set it up so that it only goes out to three pages of results.

 

If anybody knows if there is a setting I need to change or how to do this, I would be very happy.

 

Thanks,

Joseph

Posted

guess you could just limit the amount of products the database query grabs ...

 

in /catalog/products_new.php find the following:

 

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name";

 

change it to:

 

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added DESC, pd.products_name limit 0,30";

 

MAKE SURE U MAKE A BACKUP BEFORE MAKING THIS CHANGE AS I HAVN'T TESTED THIS

Posted

I tried something similar to that. I added "limit 30".

 

It returns an error message because that line of code doesn't actually create the database. First it gets sent off to a function that determines what page you are on, and that function then adds "limit 0,10" or "limit 10,20" to the end of the query. So it returned an error because when the query was finally called on the database it had two limits added to the end.

 

Don't worry, I know all about making a backup. I currently have up to catalog 20 in backups. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...