soniya_.s Posted July 17, 2015 Share Posted July 17, 2015 Hello, I have override some custom function in order confirmation controller (override/controllers/front/OrderConfirmationController), and it works fine for payment methods(Pay by Cheque, Pay by Bank-wire),but unfortunately not working for paypal payment method. Can anyone help regarding this, doesn't it be the same file i need to modify to also make it work for paypal order confirmation. Or prestashop defined some different controller for paypal order confirmation? Link to comment Share on other sites More sharing options...
bellini13 Posted July 17, 2015 Share Posted July 17, 2015 why don't you explain what you are trying to accomplish. what exactly did you change and what effect are you expecting? Link to comment Share on other sites More sharing options...
soniya_.s Posted July 18, 2015 Author Share Posted July 18, 2015 Hey, Basically i have implemented tracking pixel right after a click on "I confirm my order" button, so whenever user clicks on "I confirm my order...", it would track that particular user purchased successfully.and for that purpose i have override OrderConfirmation Controller. Only problem is in-case of paypal i didn't receive any tracking pixel on my site (http://www.abc.com/). So my goal is to receive tracking pixel on my site whenever user successfully purchased ,using any payment method(paypal, pay by bank-wire, pay by cheque).Below is the code snippet so you get better idea from code: class OrderConfirmationController extends OrderConfirmationControllerCore { public function initHeader() { .... $url = "https://www.abc.com/"; $data = array( 'VoucherCode' => $VoucherCode, 'Amount' => $OrderAmount ); $data_string = json_encode($data); $ch = curl_init($url); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch); return parent::initHeader(); } } Any help would be really appreciated. Link to comment Share on other sites More sharing options...
bellini13 Posted July 20, 2015 Share Posted July 20, 2015 So i assume you have tested the checkout process using paypal? If so, did you confirm that you even receive the order confirmation page, and that your tracking pixel appears? Link to comment Share on other sites More sharing options...
soniya_.s Posted July 20, 2015 Author Share Posted July 20, 2015 Yeah i have tested using paypal payment procedure, and after filling credit card information on paypal site, i can see order confirmation page assuring that "Your order on .... is complete." but still tracking pixel doesn't get fires on order confirmation page. Don't know if there's separate "OrderConfirmation" controller for paypal or what? Link to comment Share on other sites More sharing options...
bellini13 Posted July 22, 2015 Share Posted July 22, 2015 There is only a single order confirmation controller. What is the URL of the order confirmation page when you tested with Paypal? And instead of overriding the controller, the proper way is to create a module that uses the orderConfirmation hook. Your module will be executed anytime the order confirmation page is displayed and you can add your javascript. If it has to be in the <head>, then create the module that hooks header and then you can add your javascript when the page is the order confirmation page Link to comment Share on other sites More sharing options...
soniya_.s Posted July 30, 2015 Author Share Posted July 30, 2015 Thank you for your reply. i got following URL while testing with Paypal. "http://abc.com/da/module/paypal/submit?key=1f7f3f9b7771b0cf935390fb3e0b3767&id_module=73&id_cart=90&id_order=84" and through this url, it seems like modules/paypal/controllers/front/submit.php file is called. Now all i tried is to override paypal module's controller file, and i have placed file at location "...override\modules\paypal\controllers\front\submit.php". But still no luck, it doesn't override paypal submit.php file. is it wrong location i'm placing override file or we can't override module's controller php file anyway? Any help would be really appreciated. Link to comment Share on other sites More sharing options...
bellini13 Posted July 30, 2015 Share Posted July 30, 2015 you don't say what version of PS you are using, and I'm not entirely sure overriding module files even works properly. you might as well just make the change to the paypal module directly. Link to comment Share on other sites More sharing options...
soniya_.s Posted July 31, 2015 Author Share Posted July 31, 2015 I'm using Prestashop version "1.6.0.1.4", and yes i have tried to directly modify Paypal module' and it works as expected but the only drawback of doing this, is my changes won't be available in case i upgrade prestashop to newer version later on. Link to comment Share on other sites More sharing options...
bellini13 Posted July 31, 2015 Share Posted July 31, 2015 I'm using Prestashop version "1.6.0.1.4" do you mean 1.6.0.14 ? but the only drawback of doing this, is my changes won't be available in case i upgrade prestashop to newer version later on. upgrading prestashop does not remove your customization of a custom module. Now if you meant to say upgrading the paypal module, then you can still have issue with your override if the module changes the function you have overriden, or has changed the module in such a way that your override no longer works. 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