Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Split Page Results


Guest

Recommended Posts

Posted

Hi

 

I have the following custom page that lists all products (modified from Attitude Simple Manual Order Entry).

 

Can anybody help me with the code (and where to insert it) to apply the Split Page Results Class so that I can list it in increments of X amount of products per page. I tried to cut, paste and modify snippets of code from modules/product_listing.php and products_new.php, but I can't get it to work.

 

Thanks

 

Rudi

 

 

<?php

require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LIST_PRODUCTS);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LIST_PRODUCTS, '', 'SSL'));

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
<tr>
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
</table></td>
<!-- body_text //-->
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><?php echo TEXT_INFORMATION; ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td>
<!-- customer_orders //-->
<?php

unset($info_box_contents);

$customer_orders_string = '<table border="0" width="100%" cellspacing="0" cellpadding="1"><tr><td align="left"><font face="Verdana" size="1"><b>Description</b></td><td align="left"><font face="Verdana" size="1"><b>Price</b></td><td align="right"><font face="Verdana" size="1"><b>Quantity</b></td></tr>' . "\n" .' <form name="cart_quantity" method="post" action="'.tep_href_link(FILENAME_SHOPPING_CART, 'action=update_product', 'NONSSL').'">';

$products_query = tep_db_query("select pd.products_id, pd.products_name, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id = pd.products_id and p.products_id=ptc.products_id and ptc.categories_id = '" . (int)$current_category_id . "' and language_id = '" . $languages_id . "' and p.products_status = '1' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
$customer_orders_string .= ' <tr>' . "\n" .
//' <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products['products_id']) . '">' . $products['products_name'] . '</a></td>' . "\n" .
' <td style="border-top: 1px solid #CC0000;" class="infoBoxContents">' . $products['products_name'] . '</td>' . "\n" .
' <td style="border-top: 1px solid #CC0000;" class="infoBoxContents">' . $currencies->display_price($products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])) . '</td>' . "\n" .
' <input type="hidden" name="products_id[]" value="' . $products['products_id'] . '">'.
' <td class="infoBoxContents" align="right" valign="top"><input type="text" name="cart_quantity[]" value="' . $products_quantity[$products['products_id']] . '" size="4"></td>' . "\n" .

//' <td class="infoBoxContents" align="right" valign="top"><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id'], 'NONSSL') . '">' . tep_image(DIR_WS_ICONS . 'cart.gif', ICON_CART) . '</a></td>' . "\n" .
' </tr>' . "\n";
}
$customer_orders_string .= '<tr><td style="border-top: 1px solid #CC0000;" colspan="3" align="center"><br>'.tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART).'</td></form></table>';

$info_box_contents[] = array('align' => 'left',
'text' => $customer_orders_string);

new infoBox($info_box_contents);
?>
<!-- customer_orders_eof //-->
</td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
</table></td>
</tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Posted

I'm having the exact same problem but my file hasn't been modified, it's right from the download. It lists ALL the items in a category with "Displaying 1 of 16 (of 16 Products) Results page: 1" listed at the bottom. How do you break up the number of items per results listing??

 

Thanks

Archived

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

×
×
  • Create New...