Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Create Account/sessions/shopping cart issues


Recommended Posts

I have some serious issues with the OSC 2.2 MS2.


I built a custom module for use with goemerchant and it works fine for existing customers. I am also using the random order number contribution for orders...


The issue is that new customers come and start putting products in their cart. Then, when they want to checkout they are required to either login or create a new account. once they create the new account, the items in their shopping cart go away. So they re-add the items again...then when they want to check out it asks them to login again (I added this feature as well - when a user creates a new account, they are not automatically logged in - it didn't seem to be logging them in anyway, it was creating other issues). Anyway, so the user logs in...guess what? their shopping cart is empty again! So, frustrated, they now for the third time re-add all of the items to their cart and checkout. Now it takes them to the checkout screen because they are already logged in. They go through the whole checkout procedure, their card is charged successfully and when the checkout success screen should come up, the login screen schows up. The oprder neveer gets logged tot he db, they neveer get any confirmation email, and the store admin never has any record of the order, except that their credit was charged for xxx amount.


I think these issues are all related to the way osc is handling sessions, but I don't know enough about this subject to fix any further than what i have so far...


Please help?


PS - I added some code to match the order_id I have to send to my credit card processor to what gets entered in the db (below)


from includes/modules/payment/goemerchant.php:

-----------------------begin code------------------------

$_SESSION['global_order_id'] = $l1.$l2.$t1.$r1; //$l1.$l2.$t1.$r1 from randomizing script

-----------------------end code------------------------

and then from checkout_process.php:

-----------------------begin code------------------------

if (!empty($_SESSION['global_order_id'])) {

$ordernum = $_SESSION['global_order_id'];


else {




$t1 = date("mdy");

srand ((float) microtime() * 10000000);

$input = array ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z");

$rand_keys = array_rand ($input, 2);

$l1 = $input[$rand_keys[0]];

$l2 = $input[$rand_keys[1]];

$r1 = rand(0,9);


$ordernum = $l1.$l2.$t1.$r1;


///////////////// End of Randomizing Script




-----------------------end code------------------------


at the end of checkout_process.php i unregister the global_order_id

-----------------------begin code------------------------


-----------------------end code------------------------


Any ideas?




Link to comment
Share on other sites


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

  • Create New...