Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shopping Cart Empty on First time... weird error


Xshare

Recommended Posts

For some reason, when you first go to the store, if you try to click the little shopping cart next to a product name (without clicking into the product details), it comes to a window that says "your shopping cart is empty!". But that only happens when you click that button the first time. After that window, you can click on any of the buttons to purchase anything and it goes into the shopping cart without issues. It's weird!

 

So the problem only occurs:

  • On the first time
  • On the small buttons next to the product list
  • NOT anytime after the first time
  • NOT when clicking purchase from inside a product window

Does anyone have any idea as to why this would be happening? It would be very much appreciated!

Link to comment
Share on other sites

Figured it out, thanks to Steven on the CRE forums (found on a google search). Just to let people who find this page in the future in on how to fix it, it's a problem with the buy-now function. I don't know why, but if you just go to the line in includes/modules/product_listing.php for

 case 'PRODUCT_LIST_BUY_NOW':
		$lc_align = 'center';
		$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_1BUTTON_BUY_NOW) . '</a> '; 
		break;

 

Simply take off the "tep_get_all_get_params(array('action'))" so that the code is:

case 'PRODUCT_LIST_BUY_NOW':
		$lc_align = 'center';
		$lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
		 break;

 

And it seems to work!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...