Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Who's Online / Shopping Cart Problems


Recommended Posts

Hey Guys,


I am having a problem with my shopping cart whereby products are sometimes not getting added to my cart or it takes a couple of attempts to get the product to appear in the cart on shopping_cart.php page.


For example if I click on the add to cart icon for a product when on the product_info.php page sometimes the product will not appear in the cart and I get the "your shopping cart is empty" message on shopping_cart.php.


Other times though it will work for this product or after a couple of attempts.


Another thing associated with this shopping cart problem is that sometimes when I try to remove a product from the cart it doesn't get removed - only after a couple of tries.


I have read some other forum posts and noticed people were having trouble with shared SSL, however my problem is occuring early in the order process, before oscommerce passes the cart to https.


I have also noticed my IP address duplicated in who's online many times perhaps indicating a session problem.


I have shifted my site to a new host so perhaps some things need to change with my host to get sessions to work ok? The site was working previously with my old host.


Any suggestions would be greatly appreciated.





Link to comment
Share on other sites

I have had this problem too. It comes and goes. It seems to work itself out. I usually close my browser and delete all browser history and temp files etc. when I fire it back up it works.


I am wondering if it either a caching problem or session problem too.


I have turned off the osc caching and set in cofiguration files to store sessions in sql instead of a session directory and that works for me ... but may not work for you.

Link to comment
Share on other sites

Thanks for your suggestion insomniac2!


This is the link to my production site:




I have done some more testing and notice that when I select a product and it is redirected to the product_info.php page to display the full product if I quickly hit the add to cart button before the page has fully loaded (presumably the images) this is when I get the empty card problem.


However if I select a product from the homepage and then allow the product_info.php page to fully load, then hit the add to cart button the cart seems to work fine.


I am really stumped on this problem. I am also concerned by all the duplicate IP's I get in the who's online section. Usually mine - after I have been testing (sometimes 12 -15).


Any suggestions or ideas would be greatly appreciated.


I also have a development server which seems to work fine. It however is hosted on another server by another hosting company. It is also a couple of revisions behind the production server in terms of content:







Link to comment
Share on other sites

I forgot to mention I use mySQL to store sessions and I have caching turned off.


I don't think this is a shared SSL/hosting problem either as this is happening early in the order process before SSL is being used.


One thing to note though - I have a custom homepage and I haven't used tep_href_link() to link to my products.


It seems to work fine on my development server without using this function so not sure what the go is?





Link to comment
Share on other sites

you should use the tep_href_link function for all your site's internal links to maintain the session. Otherwise you lose the car. Other than that, check the cookies setting in your configure.php. Make sure they cover your store.

Link to comment
Share on other sites

Thanks enigma1,


I am pretty sure I have my configure.php files set up correctly with cookies covering the root of the store:


define('HTTP_COOKIE_DOMAIN', 'www.docpods.com');

define('HTTPS_COOKIE_DOMAIN', 'www.docpods.com');

define('HTTP_COOKIE_PATH', '/');

define('DIR_WS_HTTP_CATALOG', '/');

define('DIR_WS_HTTPS_CATALOG', '/');

define('HTTPS_COOKIE_PATH', '/');


Would you be able to provide an example use of tep_href_link()?


The thing that has got me confused is that I wasn't using this function on my development store and it seemed fine after doing lots of testing:




I would have thought the problem would be replicated on both development and production servers if I wasn't using this function.





Also, just to clarify, you recommend using this function everytime you create a hyperlink to another page within your store?





Link to comment
Share on other sites


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

  • Create New...