Adam Dimitrov Posted June 12, 2015 Share Posted June 12, 2015 I'm having troubles with clients choosing wrong options when it comes to delivery e.g. there delivery methods A)24h pay with paypal, credit card, etc. pay cash on delivery and they choose A) while still paying only when the order arrives, aka . And cash on delivery costs more than paying in advance. So, I'd like to know how could I customize my carriers so that certain payment options appear/don't appear. E.g. if people choose cash on delivery, then on the checkout the only options should be cash on delivery, and nothing else. Thank you. Link to comment Share on other sites More sharing options...
NemoPS Posted June 12, 2015 Share Posted June 12, 2015 There is no way of doing this without modifying each payment module, as far as I know. You need to target the hookpayment method, and return false if id_carrier is not the one you want Link to comment Share on other sites More sharing options...
Adam Dimitrov Posted June 14, 2015 Author Share Posted June 14, 2015 Hey Nemo1, Thanks for the answer. I get more and more people doing this is really starting to be a nuisance. Is it difficult to do what you suggested? Could you give me a more detailed explanation of what I must do? Link to comment Share on other sites More sharing options...
NemoPS Posted June 15, 2015 Share Posted June 15, 2015 Yes, it's not exactly easy to do it. Basically, for each payment method, open up the core php file (do you know php?). In the hookPayment method, get the carrier id (I can't remember the parameter name off the top of my head, you should try dumping $params and see if it's passed through that) and check if it's the one you want. The problem is, carrier ids will change if you edit them, so you'll have to do this again, over and over, every time yo update a carrier. Otherwise, create a module that does the check for you. But it's definitely not easy Link to comment Share on other sites More sharing options...
Recommended Posts