max number of pages

Hello Experts,

in osCommerce i wish to limit number of pages in the products_new.php.
currently the "product new" page shows all the products in the shop (5 pages) and i am trying to figure out how to set it to max 2 pages.

i guess this part of code i have attached is what deals with the "MAX_DISPLAY_PAGE_LINKS". any one knows how to add a max?



<?php
  $products_new_array = array();

  $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";
 //Replace the 12 by MAX_DISPLAY_PRODUCTS_NEW  to show 9 products in a page. 
  $products_new_split = new splitPageResults($products_new_query_raw, 20);

  if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
        //Pagination
?>
<div class="page_counter"><?php echo /*sprintf(TEXT_STYLES_FOUND, $products_new_split->number_of_rows) .'&nbsp;&nbsp;'*/ TEXT_RESULT_PAGE . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></div>     
<?php
  }
?>

Open in new window

RefaelAsked:
Who is Participating?
 
Paolo SantiangeliConnect With a Mentor Consulente InformaticoCommented:
if i got it... you have to change thi line:
  $products_new_split = new splitPageResults($products_new_query_raw, 20);

with this one:
  $products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);
0
 
Paolo SantiangeliConsulente InformaticoCommented:
Hi,
Did you try configuration >> Maximum Values >> New Products Listing from administration?

-psantiangeli
0
 
RefaelAuthor Commented:
the thing is... the the values set there are different then the pages that are actually being counted. so i it does not apply to the page. therefore it will be better to set it from within?  
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.