Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

a previous/next on the POPUP Image..


lindsayanng

Recommended Posts

Hi everyone.. I have kind of a different idea.. We have photographs as products on our site.. As it is now, a customer vies their gallery, sees a small image, and has to click it to enlarge, then if they want to see the next picture, they have to close the pop up, and then click NEXT (which I did add on the product_info.php page) which will bring them to the next product.. I was wondering, since i have the code for the previous/next already, i know that I can add that to the pop up window BUT, i have no idea how to make the POP UP go to the next LARGE image too.. Basucally, if you click the next/previous, it will bring you to the next product, but keep the same large image up.. I want that to change as well..

 

here is web page

My Website

 

here is the code for the previous/next

// ------ Previous Next ---- Joseph Roth ---- Start section
// Select the current category
$category_query = tep_db_query("select categories_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$category_info = tep_db_fetch_array($category_query);
// Select all other products from this category
$previous_next_query = tep_db_query("select products_id from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . $category_info['categories_id'] . "'");
// Scroll through products until we find the current product_id
$current_product = tep_db_fetch_array($previous_next_query);
$previous_product = $current_product;
while ($current_product['products_id'] != $HTTP_GET_VARS['products_id']) {
  $previous_product = $current_product;
  $current_product = tep_db_fetch_array($previous_next_query);
}
// We have located the current product_id and also have the previous product
$next_product = tep_db_fetch_array($previous_next_query);
// Check to make sure that there is a previous and next product and store their ids
if ($previous_product != $current_product) {
  $previous_id = $previous_product['products_id'];
}
if ($next_product != false) {
  $next_id = $next_product['products_id'];
}
// ------ Previous Next ---- Joseph Roth ---- End section

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

// ------ Previous Next ---- Joseph Roth ---- Start section
if ($previous_id != '') {
  echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $previous_id) . '">Previous Picture</a>    |    '; 
}
if ($next_id != '') {
  echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $next_id) . '">Next Picture</a>';
}
// ------ Previous Next ---- Joseph Roth ---- End section

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

There is a more elegant way to do this (more elegant = Ajax).

Open source n'est pas un échange à sens unique ... La plupart du temps un simple merci ou quelques mots d'encouragement suffisent...

Link to comment
Share on other sites

ok.. And pointers in the right direction???

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

royak, you gave an idea, but i really could use a push in the right direction

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...