WHMCS JamesX Posted January 28, 2013 Share Posted January 28, 2013 Setup -> General Settings -> Ordering -> Auto Redirect on Checkout 0 Quote Link to comment Share on other sites More sharing options...
chateaux Posted January 28, 2013 Share Posted January 28, 2013 When a customer completes their order, they are directed from the payment complete page to the: viewinvoice.php page. How do I turn this off so that the customer stays at the payment complete page? Thanks! 0 Quote Link to comment Share on other sites More sharing options...
chateaux Posted January 28, 2013 Share Posted January 28, 2013 Updating the settings: Setup -> General Settings -> Ordering -> Auto Redirect on Checkout influences how the customer gets to the payment pages and not what happens after payment. The process is as follows: 1. User selects product and picks payment channel (paypal in this case) 2. User is directed to paypal to make payment 3. On payment, user is directed to the viewinvoice.php instead of the usual payment complete page I have a hook that executes on ShoppingCartCheckoutCompletePage which is now being skipped... 0 Quote Link to comment Share on other sites More sharing options...
WHMCS JamesX Posted January 28, 2013 Author Share Posted January 28, 2013 (edited) My bad, I'd misread your OP as being to stay on the order completed page (as in, no payment redirection); it's been a long evening. If I recall, the hook point (ShoppingCartCheckoutCompletePage) that you've referenced is executed when "Auto Redirect on Checkout" is set to "Just show the order completed page (no payment redirect)" regardless of invoice status (i.e. Paid, Unpaid). However, with either of the other two options selected, it would only be executed if the invoice doesn't have a status of Unpaid. I seem to remember a couple of other things that could affect it, but that's the short of it though. What are you actually wanting to do with your action hook? Perhaps, there's a better hook point to use for it. Edited January 28, 2013 by WHMCS JamesX 0 Quote Link to comment Share on other sites More sharing options...
chateaux Posted January 28, 2013 Share Posted January 28, 2013 Hmm... It was working last week however I was distracted on Friday and left in the middle of finishing off the hook point code and while updating admin settings. Originally set to: Automatically forward the user to the payment gateway And payment after the merchant gateway would return to the "order complete page", without a hassle. So now the payment complete page is skipped... Maybe there is a better way to do this. I have an external app, users select a subscription and are directed to WHMCS, they select the payment option and are directed to the vendor to make payment, after payment they are redirected back to the whmcs payment complete page, the hook checks $ispaid and updates the app subscription table and finally redirects the user back to the app with a validated subscription. I have opened a support ticket for this as well... as I am completely out of ideas. 0 Quote Link to comment Share on other sites More sharing options...
chateaux Posted January 28, 2013 Share Posted January 28, 2013 The correct payment complete page is outlined in this thread: http://forum.whmcs.com/showthread.php?39008-what-is-the-order-success-url I added to the post, hoping someone can help me out. I have wasted the whole day trying to figure this issue out... 0 Quote Link to comment Share on other sites More sharing options...
chateaux Posted January 28, 2013 Share Posted January 28, 2013 Weird behaviour: I notice that if I land on this page: http://www.domain.com/viewinvoice.php?id=68&paymentsuccess=true&tx=1JG71505CV8649611&st=Completed&amt=0.02&cc=USD&cm=68&item_number= and I hit refresh It will divert to: http://www.domain.com/cart.php?a=complete This may be due to the hook point I have created which pulls in some of the class files from my app and runs a db connection to the app db... I will test this, and if the db proves to be causing the strain I may have to reconsider how I update the app... 0 Quote Link to comment Share on other sites More sharing options...
chateaux Posted January 28, 2013 Share Posted January 28, 2013 More reasons for this problem to happen. When you write a hook, it seems white spaces causes the hook not to work as expected. After removing white spaces from the <? and the function name as well as before the ?> tag, the problem seemed to sort its self out. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.