Jump to content



Latest News: (loading..)

- - - - -

Need Help with Product Info Page


This topic has been archived. This means that you cannot reply to this topic.
No replies to this topic

#-19   surrfman

surrfman
  • Members
  • 357 posts

Posted 19 March 2012 - 10:00 PM

Trying to get the Product info page to return to the previous page. It is possible to go to the product info page from three other pages, shopping cart and product listing. Problem is all i can get it to do from any page is go back to the shopping cart page.

Here is my code:


  <div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>

  
<?php $referer = $_SERVER['HTTP_REFERER'];
   if (isset($HTTP_REFERER)) {
  echo tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w') ."<a href='$HTTP_REFERER'></a>";
   } else {
   echo "<a href='javascript:history.back()'></a>". tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w'); }
    ?>
    <?php // echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?>
  </div>

I've tried a hundred different ideas, searched the 'net, all code i find, while a bit different all works, but just won't go back to the previous page. is there a possibilty the first couple lines is the problem?


i did get this to work, but of course got a link on page and not a button:

<div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary'); ?></span>

<td class="main">
<?php $referer = $_SERVER['HTTP_REFERER'];
   if (!$referer == '') {
  echo '<a href="' . $referer . '">' . tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w') . '</a>';
   } else {
   echo '<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($current_category_id = '')) . '">' . tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w') . '</a>'; }
    ?></td>
    <?php // echo tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] > 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params())); ?>

</div>


I can't see what I am not getting.... PLEASE HELP!! about to gte out the Jack bottle!!!


  Timmy C