Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

on a long product page, after hitting add to cart, how do i have the screen return to the same spot on the page as opposed to the top of the page.


b00

Recommended Posts

please help with two questions:

1. on a long product page, after hitting add to cart, how do i have the screen return to the same spot on the page as opposed to the top of the page. how do i do this?

2. in my code below i would like to sort the products, probably on name, how do i do this?

 

i started work on modifying the product_listing module. basically i replaced almost all of the product listing module with the new_products module so that i list products three to a row in the format i set up. here is the code:

<?php
/*
 $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License



*/

//  original line:   $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id');

//  the 500 on the next line is the limit of products displayed
$listing_split = new splitPageResults($listing_sql, 500, 'p.products_id');
?>
<!-- new_products //-->
<?php 
 $info_box_contents = array();
 $info_box_contents[] = array('text' => sprintf('', ''));

 new contentBoxHeading($info_box_contents);



 $row = 0;
 $col = 0;
$listing_query = tep_db_query($listing_split->sql_query);
 $info_box_contents = array();
  while ($listing = tep_db_fetch_array($listing_query)) {
$listing['products_name'] = tep_get_products_name($listing['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="bottom"',
									   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'  . '   '  . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id']))  . '<br>' . '<a href="' . tep_href_link(FILENAME_INDEX, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) .  '<br><br><br><br>'  . '</a>' );
$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }

 new contentBox($info_box_contents);
?>
<!-- new_products_eof //-->

 

thank you for your consideration

:>)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...