Acheron Posted June 29, 2004 Posted June 29, 2004 Just a small step up from simply adding a Back button to your product info page. ;) There may be a better way, but I already had the extra query in my page for a META tags mod I'm working on. If I have forgotten something, please lmk as I have heavily modded my site and can't remember what is original anymore. FIND: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); ADD BELOW (or anywhere within PHP tags): $cat_title_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cat_id['categories_id'] . "'"); $cat_title = tep_db_fetch_array($cat_title_query); FIND (or something similar): <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> ADD ABOVE: <td class="main"><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath); ?>"><?php echo tep_image_button('button_back.gif', 'Back to ' . $cat_title['categories_name'] . ' '); ?></a></td> You can adjust the placement of the buttons by setting column widths if you'd like, move 'em around, etc. The alt text on the 'Back' button will now say 'Back to [category name]' :)
Guest Posted December 10, 2004 Posted December 10, 2004 should this work whit 2.2 m2 when i hit the back button iwant to go back to the page i came from e.x page 24 not page 1 again
boxtel Posted December 10, 2004 Posted December 10, 2004 Just a small step up from simply adding a Back button to your product info page. ;) There may be a better way, but I already had the extra query in my page for a META tags mod I'm working on. If I have forgotten something, please lmk as I have heavily modded my site and can't remember what is original anymore. FIND: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); ADD BELOW (or anywhere within PHP tags): $cat_title_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cat_id['categories_id'] . "'"); $cat_title = tep_db_fetch_array($cat_title_query); FIND (or something similar): <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> ADD ABOVE: <td class="main"><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath); ?>"><?php echo tep_image_button('button_back.gif', 'Back to ' . $cat_title['categories_name'] . ' '); ?></a></td> You can adjust the placement of the buttons by setting column widths if you'd like, move 'em around, etc. The alt text on the 'Back' button will now say 'Back to [category name]' :) <{POST_SNAPBACK}> use this myself : <td align="left"><a href="<?php echo $HTTP_REFERER; ?>"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td> Treasurer MFC
Guest Posted December 10, 2004 Posted December 10, 2004 Thank you Acheron :D It works exactly as i want now :lol: Really Great
Guest Posted December 10, 2004 Posted December 10, 2004 :blush: HI again This butto works fine from product listing to product info but if you put the product in your basket and hit the back button your not going anywhere exept to the product info over and over again
boxtel Posted December 10, 2004 Posted December 10, 2004 :blush: HI againThis butto works fine from product listing to product info but if you put the product in your basket and hit the back button your not going anywhere exept to the product info over and over again <{POST_SNAPBACK}> that is when you have the setting not to go to the cart after adding a product. php then does a reload of the page to add and update your cartbox. Hence, the http_referrer is the same page you are on. Treasurer MFC
Guest Posted December 10, 2004 Posted December 10, 2004 HI if i am a customer i would not want to go to the cart i would like to go back and countinue shopping ther is a continue shopping button in the cart but it take you back to product info and back button in product info take ypu back to the cart solutions??
boxtel Posted December 10, 2004 Posted December 10, 2004 HIif i am a customer i would not want to go to the cart i would like to go back and countinue shopping ther is a continue shopping button in the cart but it take you back to product info and back button in product info take ypu back to the cart solutions?? <{POST_SNAPBACK}> fair enough, try this code: <?php $back = sizeof($navigation->path)-2; ?> <td align="left"><a href="<?php echo tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) ; ?>"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td> Treasurer MFC
Guest Posted December 10, 2004 Posted December 10, 2004 Sorry Did not work it?s acting the same way as the first
oldworldcharms Posted December 28, 2004 Posted December 28, 2004 Good idea, thanks but the first one didnt work. The back button alt tag says "Back to" but doesnt echo the catagory name. Can this be fixed? I would try the code above but I am new and don't know where to put it and dont understand the problem it solves. Where should I put this code. Sorry Did not work it?s acting the same way as the first <{POST_SNAPBACK}>
oldworldcharms Posted January 31, 2005 Posted January 31, 2005 My back button code is on the items page but keeps dissapearing. Any ideas why or how I can fix it? Thanks <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require_once('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); //rmh M-S_select begin if ( (isset($HTTP_GET_VARS['attrib_error'])) && ($HTTP_GET_VARS['attrib_error'] = '1')) { $messageStack->add_session('product_info', ERROR_NO_ATTRIBUTE); tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'])); } //rmh M-S_select end //rmh M-S_multi-stores edited next line $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_STORES . " p2s where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and p.products_id = p2s.products_id and p2s.stores_id = '" . STORES_ID . "' and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!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; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=<?php echo (tep_not_null(POPUP_WINDOW_WIDTH) ? POPUP_WINDOW_WIDTH : '100'); ?>,height=<?php echo (tep_not_null(POPUP_WINDOW_HEIGHT) ? POPUP_WINDOW_HEIGHT : '100'); //rmh M-S_pics ?>,screenX=100,screenY=100,top=20,left=100') } //--></script> </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 //--> <?php $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_height, p.products_dimensions, p.products_width, p.products_depth, p.products_style, p.products_condition, p.products_year, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); $pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id); $products_price=$pf->getPriceString(); if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">' . $product_info['products_model'] . '</span>'; } else { $products_name = $product_info['products_name']; } if ($messageStack->size('product_info') > 0) { } ?> <table border="0" width="100%" height="447" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0"> <tr height="75%"> <td width="40%" valign="top" height="348"> <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2"> <TR> <TD width="100%"> <table cellpadding="6" style="border-collapse: collapse" bordercolor="#111111" cellspacing="0"> <tr> <td> <?php echo '<a onclick="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\'); return false;" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH*1.8, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="productInfoThumbnail"') . '</a>'; ?> </td> </tr> <tr> <td> <table border="0" cellspacing="0" cellpadding="2" style="border-collapse: collapse" bordercolor="#111111"> <tr> <?php if (DISPLAY_PEI_HORIZONTALLY == 'true') { $rowcount=1; $products_extra_images_query = tep_db_query("SELECT products_extra_image, products_extra_images_id FROM " . TABLE_PRODUCTS_EXTRA_IMAGES . " WHERE products_id='" . $product_info['products_id'] . "'"); while ($extra_images = tep_db_fetch_array($products_extra_images_query)) { ?> <td class="main" width="<?php echo EXTRA_IMAGE_WIDTH; ?>" valign="top"> <?php echo (DISPLAY_PEI_CLICK_TO_ENLARGE == 'false' ? '' : '<a onclick="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'peiID=' . $extra_images['products_extra_images_id']) . '\'); return false;" href="' . tep_href_link(DIR_WS_IMAGES . $extra_images['products_extra_image']) . '" target="_blank">') . tep_image(DIR_WS_IMAGES . $extra_images['products_extra_image'], addslashes($product_info['products_name']), EXTRA_IMAGE_WIDTH, EXTRA_IMAGE_HEIGHT, 'hspace="5" vspace="5" class="productInfoThumbnail"') . (DISPLAY_PEI_CLICK_TO_ENLARGE == 'false' ? '' : '</a>');?> </td> <?php if ($rowcount == MAX_DISPLAY_PEI_PER_ROW){ echo '</tr><tr>'; $rowcount=1; } else { $rowcount=$rowcount+1; } } } ?> <P align="center" style="margin-top: +8"> </tr> </table> </td> </tr> </table> <DIV align="center"> <CENTER> <TABLE border="0" cellpadding="3" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <TR> <TD width="100%" class="enlarge" height="26"> <P align="center"> <IMG border="0" align="middle" src="https://secure66.nocdirect.com/~joldworl//catalog/images/icons/EnlargeView_Icon.gif" alt="Enlarge" width="22" height="22">Click To Enlarge </td> </tr> <TR> <TD width="100%" height="18"> <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <TR> <TD width="4%"> </TD> <TD width="31%"> </TD> <TD width="9%"> </TD> <TD width="1%"> </TD> </TR> <TR> <TD width="4%"> </TD> <TD width="31%"> <TABLE border="1" cellpadding="3" style="border-collapse: collapse" bordercolor="#E2E2E2" width="100%"> <TR> <TD width="100%" class="question_2" align="center"> <TABLE border="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <TR> <TD width="100%" align="center"> <FONT color="#800000" style="font-weight: 700; font-size:9pt" face="Arial"> Need Help?</FONT></TD> </TR> <TR> <TD width="100%" align="center" class="question_2"> <P style="margin-bottom: 3"> <a href="ask_a_question.php?products_id=<?php echo $product_info['products_id']; ?>" ONMOUSEOVER="window.status='.:: Ask a question about this item ::.' ; return true" style="text-decoration: none"> <FONT color="#666666">To ask a question </FONT></a> <FONT color="#666666"> <a href="ask_a_question.php?products_id=<?php echo $product_info['products_id']; ?>" ONMOUSEOVER="window.status='.:: Ask a question about this item ::.' ; return true" style="text-decoration: none"> click here</a></TD> </TR> <TR> <TD width="100%" align="center" class="question_2"> Call Us:1-877-473-3249</TD> </TR> <TR> <TD width="100%" align="center" class="question_2"> <A href="http://chat.boldchat.com/chat/visitor.jsp?cdid=3169310309"> <FONT color="#800000">Online Chat</FONT></A></TD> </TR> </TABLE> </TD> </TR> </TABLE> </TD> <TD width="7%"> </TD> <TD width="1%"> </TD> </TR> </TABLE> </td> </tr> <TR> <TD width="100%" height="18"> </td> </tr> <TR> <TD width="100%" height="18"> </td> </tr> <TR> <TD width="100%" height="18" align="center"> <P align="center"> </td> </tr> <TR> </td> </tr> </TD> </TR> </TABLE> </CENTER> </DIV> </TD> </TR> </TABLE> </td> <td valign="top" class="main" height="348"> <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%"> <TR> <td valign="top"><font class="productname"><?php echo $products_name; ?></font></td><td class="pageHeading" align="right" valign="top"> </TD><TR> <TD width="100%"> </TD> </TR> <TR> <TD width="100%" class="main"><?php echo stripslashes($product_info['products_description']); ?></p> <?php // extra field modifications gs if (tep_not_null($product_info['products_url'])) { echo '<p>' . sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)). '</p>'; } if (tep_not_null($product_info['products_dimensions'])) { echo '<p>' . TEXT_PRODUCTS_DIMENSIONS . ' ' . stripslashes($product_info['products_dimensions']) . '</p>'; } if (tep_not_null($product_info['products_height'])) { echo '<p>' . TEXT_PRODUCTS_HEIGHT . ' ' . stripslashes($product_info['products_height']) . '</p>'; } if (tep_not_null($product_info['products_width'])) { echo '<p>' . TEXT_PRODUCTS_WIDTH . ' ' . stripslashes($product_info['products_width']) . '</p>'; } if (tep_not_null($product_info['products_depth'])) { echo '<p>' . TEXT_PRODUCTS_DEPTH . ' ' . stripslashes($product_info['products_depth']) . '</p>'; } if (tep_not_null($product_info['products_style'])) { echo '<p>' . TEXT_PRODUCTS_STYLE . ' ' . stripslashes($product_info['products_style']) . '</p>'; } if (tep_not_null($product_info['products_condition'])) { echo '<p>' . TEXT_PRODUCTS_CONDITION . ' ' . stripslashes($product_info['products_condition']) . '</p>'; } if (tep_not_null($product_info['products_year'])) { echo '<p>' . TEXT_PRODUCTS_YEAR . ' ' . stripslashes($product_info['products_year']) . '</p>'; } if (tep_not_null($product_info['products_reference'])) { echo '<p>' . TEXT_PRODUCTS_REFERENCE . ' ' . stripslashes($product_info['products_reference']) . '</p>'; } if ( ($product_info['products_quantity'] <= 0) && (STOCK_CHECK =='true') ) { echo '<br>' . TEXT_OUT_OF_STOCK . '<br><br>'; } else { echo '<p><font class="productprice">' . TEXT_PRODUCTS_PRICE . ' ' . stripslashes($products_price) . '</font></p>'; } //echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> </TD> </TR> </TABLE> <TABLE border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td align="left" height="18" colspan="3" class="main"> <P align="right"><img src="http://www.oldworldcharms.net/catalog/includes/languages/english/images/buttons/button_tell_a_friend.gif" width="17" height="16"> <a href="tell_a_friend2.php?products_id=<?php echo $product_info['products_id']; ?>" ONMOUSEOVER="window.status='.<?php echo TELL_FRIEND ; ?> .' ; return true"> <?php echo TELL_FRIEND ; ?> </td> </tr> <tr> <td align="left" height="18" colspan="3"> <HR noShade color="#E2E2E2" size="1"> </td> </tr> <tr> <td align="left" height="18"> <?php if ( ($product_info['products_quantity'] <= 0) && (STOCK_CHECK =='true') ) { } else { echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?> </form> <?php } ?> </td> <td align="right" height="18"> <P align="left"><?php //echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>';?> <?php $back = sizeof($navigation->path)-2; if (isset($navigation->path[$back])) { ?> <td class="main" align="left"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <?php } ?> </tr> <tr> <td colspan="2" align="left" height="63"> <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <TR> <TD width="100%" class="question_2"> <P style="margin-top: 14">Order by phone: 1-877-473-3249, American Express, MasterCard, Visa, Paypal, Check, MO accepted.</TD> </TR> </TABLE> <TABLE border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <TR> <TD width="100%"> </TD> </TR> <TR> <TD width="100%"> </TD> </TR> </TABLE> </td> </TD> </TR> </TABLE> </td> </tr> </table> <!-- 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></body></html><?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
boxtel Posted February 1, 2005 Posted February 1, 2005 Just a small step up from simply adding a Back button to your product info page. ;) There may be a better way, but I already had the extra query in my page for a META tags mod I'm working on. If I have forgotten something, please lmk as I have heavily modded my site and can't remember what is original anymore. FIND: require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); ADD BELOW (or anywhere within PHP tags): $cat_title_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cat_id['categories_id'] . "'"); $cat_title = tep_db_fetch_array($cat_title_query); FIND (or something similar): <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> ADD ABOVE: <td class="main"><a href="<?php echo tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cPath); ?>"><?php echo tep_image_button('button_back.gif', 'Back to ' . $cat_title['categories_name'] . ' '); ?></a></td> You can adjust the placement of the buttons by setting column widths if you'd like, move 'em around, etc. The alt text on the 'Back' button will now say 'Back to [category name]' :) <{POST_SNAPBACK}> I have started to use the breadcrumb now. I added this function to the class : function get_last($x = 1) { $index = sizeof($this->_trail) - $x; return ($this->_trail[$index]['link']); } and use this in product_info.php : <td align="left"><a href="<?php echo $breadcrumb->get_last(1) ; ?>"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td> Treasurer MFC
wheeloftime Posted February 1, 2005 Posted February 1, 2005 I have started to use the breadcrumb now.I added this function to the class : function get_last($x = 1) { $index = sizeof($this->_trail) - $x; return ($this->_trail[$index]['link']); } and use this in product_info.php : <td align="left"><a href="<?php echo $breadcrumb->get_last(1) ; ?>"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td> <{POST_SNAPBACK}> Hi Amanda, I just tried these but with get_last(1) I can never leave the product info page whether I add to cart or not. With get_last(2) the back button works but has the same behaviour as the other solutions; coming from ie. page 3 you always go back to page 1 :( Only using the browser back button gives the required result but I really would like a back button within the product info page if it could do the same. I tried every solution I found on the board but none so far does what you would expect it to do. This really is a tough one :( Thanks for your continuing support !
boxtel Posted February 1, 2005 Posted February 1, 2005 Hi Amanda, I just tried these but with get_last(1) I can never leave the product info page whether I add to cart or not. With get_last(2) the back button works but has the same behaviour as the other solutions; coming from ie. page 3 you always go back to page 1 :( Only using the browser back button gives the required result but I really would like a back button within the product info page if it could do the same. I tried every solution I found on the board but none so far does what you would expect it to do. This really is a tough one :( Thanks for your continuing support ! <{POST_SNAPBACK}> Well, I used http_referer before this but since I use page cache, that would result in customers going back to where the first customer came from because that link is stored in the cache file. So if you use page cache, the only alternative is to have a fixed return point for everybody and although not perfect, the next level up is still the best. index 1 or 2 etc. depends on what you store in your breadcrumb, I no longer store the product name but leave it at the category. so for me it is 1, for others it might be 2 or even 3 if they also include the model for instance. Treasurer MFC
wheeloftime Posted February 1, 2005 Posted February 1, 2005 Well, I used http_referer before this but since I use page cache, that would result in customers going back to where the first customer came from because that link is stored in the cache file. So if you use page cache, the only alternative is to have a fixed return point for everybody and although not perfect, the next level up is still the best. index 1 or 2 etc. depends on what you store in your breadcrumb, I no longer store the product name but leave it at the category. so for me it is 1, for others it might be 2 or even 3 if they also include the model for instance. <{POST_SNAPBACK}> I don't use page_cache (interferes too much with some dynamic parts) and I tried your http_referer option a while ago. For my shop that was the best and only solution which indeed brought the customer back to where he really came from unless he used add to cart and got stuck. With index 3 I go back to the main page so index 2 is the only valid option right now. How comes this is such a tough one to tackle ? I guess with some javascript history(-1) it would work but then you would solely rely on javascript.
boxtel Posted February 1, 2005 Posted February 1, 2005 I don't use page_cache (interferes too much with some dynamic parts) and I tried your http_referer option a while ago. For my shop that was the best and only solution which indeed brought the customer back to where he really came from unless he used add to cart and got stuck.With index 3 I go back to the main page so index 2 is the only valid option right now. How comes this is such a tough one to tackle ? I guess with some javascript history(-1) it would work but then you would solely rely on javascript. <{POST_SNAPBACK}> well, normally it should work with the registered variable "navigation_history" but then you have to update that on every page. And it goes wrong if you come directly from outside your site, from google for instance because then you have no history and you get this "unable to determine link" stuff. With referer I first checked if the referer was the same as the current page. If so, I would go back to index. That way you prevent from getting stuck in the cart after a cart update because then you are in the cart and coming from the cart... Treasurer MFC
wheeloftime Posted February 1, 2005 Posted February 1, 2005 well, normally it should work with the registered variable "navigation_history" but then you have to update that on every page. And it goes wrong if you come directly from outside your site, from google for instance because then you have no history and you get this "unable to determine link" stuff. With referer I first checked if the referer was the same as the current page. If so, I would go back to index. That way you prevent from getting stuck in the cart after a cart update because then you are in the cart and coming from the cart... <{POST_SNAPBACK}> I see the troubles. If there was only a way to save the referer just before going to the product info page and use that when clicking the back button it should solve it nicely (I hope and with taking into account a customer could indeed come from outside). If I ever find a proper way you'll know but it might be wiser to live with the given solution :D
boxtel Posted February 1, 2005 Posted February 1, 2005 I see the troubles. If there was only a way to save the referer just before going to the product info page and use that when clicking the back button it should solve it nicely (I hope and with taking into account a customer could indeed come from outside). If I ever find a proper way you'll know but it might be wiser to live with the given solution :D <{POST_SNAPBACK}> well, that is exactly what the class navigation_history attempts to do. However, I think I will give that java command a try as that should also work for cached pages. And I need cache as I am only on an 800Mhz/256MB/ADSL machine. Treasurer MFC
wheeloftime Posted February 1, 2005 Posted February 1, 2005 well, that is exactly what the class navigation_history attempts to do. However, I think I will give that java command a try as that should also work for cached pages. And I need cache as I am only on an 800Mhz/256MB/ADSL machine. <{POST_SNAPBACK}> So your hosting your shop from home ?! I have been thinking on that also for quiet some while but with a meager 25 Kb upload I wouldn't dare to do this. Renting a fatter line is too costly compared to what good hosting facilities nowadays cost but as soon as affordable VDSL is coming available AND the business makes it worthwhile enough I rather like to take everything into my own hands.
TCwho Posted February 11, 2005 Posted February 11, 2005 I was trying to do something similar here: http://www.oscommerce.com/forums/index.php?act...ndpost&p=544205 but found a bug concerning the code: <td class="main"> <?php $back = sizeof($navigation->path)-3; // Go back 2 screens echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?> </td> Read the thread in link above, because the problem I encountered most likely would cause the same behavior in anything similar..... ...I think Boxtel might have the right idea with using the Breadcrumb trial, although I have not tried it yet... Drop_Shadow How Did You Hear About Us Email HTML Order Link ---- GMT -5:00
Recommended Posts
Archived
This topic is now archived and is closed to further replies.