jucedupp Posted April 21, 2016 Share Posted April 21, 2016 We have a use case where clients subscribe to a club, for which they will be debited later. Our client wants to be able to track these sales via the gananlytics module. For free orders, the client is redirected to his account page, so the ganalytics module is not firing. How / where in code can I redirect the user to order confirmation (which has a hook for the ganalytics module) instead of the user's account / orders? Thanks.. Jacques Link to comment Share on other sites More sharing options...
shokinro Posted April 21, 2016 Share Posted April 21, 2016 you need modify or override (better) following controller classes /controllers/front/OrderController.php // Bypass payment step if total is 0 if (($id_order = $this->_checkFreeOrder()) && $id_order) { if ($this->context->customer->is_guest) { $order = new Order((int)$id_order); $email = $this->context->customer->email; $this->context->customer->mylogout(); // If guest we clear the cookie for security reason Tools::redirect('index.php?controller=guest-tracking&id_order='.urlencode($order->reference).'&email='.urlencode($email)); } else { Tools::redirect('index.php?controller=history'); } } 1 Link to comment Share on other sites More sharing options...
Mlody Posted July 31, 2018 Share Posted July 31, 2018 (edited) I have this same problem with Prestashop 1.7. Where I should put this code in OrderController.php ? Will this work for 1.7? Could you help me? Edited July 31, 2018 by Mlody (see edit history) Link to comment Share on other sites More sharing options...
Vinkula Posted June 13, 2019 Share Posted June 13, 2019 In Prestashop 1.7: OrderConfirmationController.php 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now