Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Need To Log User Out Automatically After Checkout Rate Topic   - - - - -


Posted 07 March 2016 - 05:50 PM #1

We are using the cart in a different way than as a typical storefront.  Once an order is completed (payment made and final summary page displayed), we want the user who placed the order to be logged out automatically.  That way, when a new order begins the site is ready for a new customer and does not remember the information for the person who just placed an order.


(1) Is there a hook that provides me access at the needed point where I can call a logout function yet still allow the final checkout summary screen be displayed?


(2) If not, how would I accomplish what I am trying to do without requiring the user to click a logout button?


(3) If yes, how would I accomplish the logout and still keep the user on the summary page?


(4) Another option would be, is there a setting within CS-Cart that tells the system not to remember a customer once the order is completed?



  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20910 posts

Posted 09 March 2016 - 08:05 AM #2

Please use the order_placement_routines hook in the fn_order_placement_routines function (app/functions/fn.cart.php) and call the following function:


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)


Posted 10 March 2016 - 01:23 AM #3

Thank you for your response, but that did not work for me.  After I did the logout within order_placement_routines, I ended up back at a login screen (fn_user_logout calls fn_login_user). I was hoping the person would be able to see the order details, in case they wanted to print it, but that does not seem to be possible because they have to be logged in to view it.  I'm checking with the client to confirm what they want to happen after the order is complete.  I may be able to copy most of what happens within fn_user_logout but replace the call to fn_login_user with my own redirect.


Thanks again, you got me headed in the right direction.