Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding page value to back button


cruithne

Recommended Posts

Posted

Hi, I'm new to PHP and don't really understand the syntax yet. I'm trying to add make the back button on the product_info page (e.g. .../product_info.php?cPath=21&products_id=29) return to the page it was on previously. For the design of the site, only one product is displayed per page.

 

At the moment I can get the code to return me to the start of the category (the very first product in the category) but it would be preferable to return to actual page related to the product.

 

The code for the button is as follows:

 

<td class="main" align="left"><?php echo '<a href="' . tep_href_link('index.php', ($cPath ? 'cPath=' . $cPath . '&' : '') . 'page=' . $listing['page_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

 

but it only comes up with:

 

...store/index.php?cPath=21&page=

 

Is it possible to add a value for the page number? Preferably one related to the page before.

 

I considered using the history back button. But the problem with that is if the customer were to add the product to their cart, then click "continue shopping" then click the back button, they would be returned to their cart rather than the catalog.

 

Thanks in advance for any help,

~ Andrew

Archived

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

×
×
  • Create New...