Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Problem with Purchase from Manufacturers Search


Recommended Posts


I hope I can explain this problem clearly:

If I select a manufacturer I get a list of all products by that manufacturer with a description and "Buy It" button which is all fine. Hovering over the buy it uttons you can see different urls for each product a the bottom of the screen.

I buy one product and it adds to the shopping cart. No problem.

However when I continue shopping and select a different product, from the same manufacturer, it does not add it to the cart but increases the quantity of the first product to 2 and so on.

If I browse to a category and buy multiple products from the list it works okay. Just a problem when purchasing from a manufacturers selection.

With the products listed by manufacturer, hovering the mouse over each "Buy It" button initially gives the prducts url at the bottom of the screen. However after buying one item and then returning to the list after clicking "Continue Shopping" all products appear to have the same url of first product bought when hovered over.

Has anyone else experience this?

Any help would be appreciated.



Link to comment
Share on other sites

  • 1 year later...

I know this is an old post and not relevant to 2.3 but for those using 2.2 (like me) this is still an issue.


The problem appears to be that when the 'continue shopping' button is clicked it sends the customer back to the manufacturer's listing page with a GET value in the url &products_id=xxxx - for some reason the listing page grabs &products_id=xxxx and appends it to the buy now button.


The buy now button is created in the file includes/modules/product_listing.php

		$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';


However $listing['products_id'] is getting replaced by the product_id passed in the url - I have absolutely no idea where or why this happens after ages looking through the code.


So here's a bit of code that will fix the problem by intercepting the return url in the shopping cart - it may not be elegant code and you use it at your own risk (but it works OK for me)


in shopping_cart.php find the following:


if (isset($navigation->path[$back])) {
			<td class="main"><?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_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>


and replace it with


if (isset($navigation->path[$back])) {

  $the_link=tep_array_to_string($navigation->path[$back]['get'], array('action'));

$search=strpos($the_link, 'manufacturers_id');
 if ($search!==false){
  $check=explode ('&',$the_link);
   unset ($check[1]);

			<td class="main"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], $the_link, $navigation->path[$back]['mode']) . '">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></td>


Link to comment
Share on other sites


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

  • Create New...