Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

add to cart button does different things?


memzz

Recommended Posts

Hi guys hope someone can help me or point me in the right direction even . . Its a bit hard to explain but basically whats happening is this . .

 

I have set 'display cart after adding product' to false in the admin section . .

 

If i click on 'buy now button' from within the product listing and the product has attributes then the product page will display which is fine and expected, if i then click add to cart then the user will remain on the product page, which is also fine.

 

The problem occurs if the user clicks on the product image (from within product listing) to get to the product_info page, now if they click 'add to cart' on the product_info page then the product is added to the cart ok but now they are directed to to the index page instead of remaining on the product_info page?

 

It only happens if they click on the product image from the product_listing page.

 

Any ideas why this could be occuring?

 

Thanks in advance . .

Link to comment
Share on other sites

Hi

 

Here's the code in application_top that handles the $goto that is meant to redirect after adding to cart (this is from 2.3.3)

 

   if (DISPLAY_CART == 'true') {
  $goto =  FILENAME_SHOPPING_CART;
  $parameters = array('action', 'cPath', 'products_id', 'pid');
   } else {
  $goto = basename($PHP_SELF);
  if ($HTTP_GET_VARS['action'] == 'buy_now') {
    $parameters = array('action', 'pid', 'products_id');
  } else {
    $parameters = array('action', 'pid');
  }
   }

 

$goto is then used further down the page e.g. tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))

 

Somehow the value of that is not being updated - you could try hacking (oops - sorry I mean Custom Code) the chunk into:

 

 //  if (DISPLAY_CART == 'true') {
 //    $goto =  FILENAME_SHOPPING_CART;
 //    $parameters = array('action', 'cPath', 'products_id', 'pid');
 //  } else
{
  $goto = basename($PHP_SELF);
  if ($HTTP_GET_VARS['action'] == 'buy_now') {
    $parameters = array('action', 'pid', 'products_id');
  } else {
    $parameters = array('action', 'pid');
  }
   }

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...