Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unable to add items to cart


kbeggan

Recommended Posts

Please forgive me, I know it's annoying when new members post questions which have already been asked without having searched the forums first. Rest assured, I've attempted to search for an answer, but have been unsuccessful. I appreciate any help you guys could provide.

 

I just installed osCommerce 2.1 onto my server. It looks like a very promising product, but when I log in and attempt to add a single item to my cart, it jumps to shopping_cart.php (as I suppose it should), but shows that "Your Shopping Cart is empty!"

 

I've fiddled with cookies and session on osCommerce Admin panel, my server and my browser, but to no avail.

 

Can anybody help?! Thanks in advance.

Link to comment
Share on other sites

Haven't you modded the shop at all and it still doesnt work?

 

You can look and see if you have this line in /include/application_top.php:

	  // customer adds a product from the products page
  case 'add_product' :	if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {


							$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

								case 'remove_product' :	if (isset($HTTP_GET_VARS['products_id'])) {
							 $cart->remove($HTTP_GET_VARS['products_id']);
						  }
						  break;

 

and this one:

 

 // performed by the 'buy now' button in product listings and review page
  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
							if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
							  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
							} else {
							  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
							}
						  }
						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
						  break;

 

but If the shop isnt modified theres no need to check them, an advice would be to just reinstall it then because it would only take about 10 minutes.

Link to comment
Share on other sites

Dennis,

 

Thank you for your response. To answer your question, I have made zero modifications to the installation.

 

I've tried to reinstall and still get the same results.

 

Something is definitely not working properly. After installation, everything appears normal until I click on an item (The Matrix for example). Then all prices show as zero and the cart doesn't work.

 

Any suggestions?

Link to comment
Share on other sites

*****RESOLVED*****

 

I was able to update my php.ini file to change register_globals = On.

 

This fixed both the pricing AND shopping cart issues. Thanks to anyone who took the time to help out.

 

 

 

Where is php.ini? I can't find it :(

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...