jamshidpour Posted December 28, 2016 Share Posted December 28, 2016 Hello mates, I want to be able to set COD payment option only for certain region or city? COD is usable only if customer's city is where our stock located. So we can send our product to customer quickly and wait for COD. It's not logical to send the products 1000km far also while we didn't get paid. So COD needs to be restricted to certain region/city. I saw a solution here but seems it was for previous version of prestashop because when i added it to the cashondelivery.php file (in cashondelivery module folder), the blank page appeared when going to Step 5 of order process (step 5 = payment options). As i read in that topic it seems the following code works there for them: public function hookPayment($params) { if (!$this->active) return ; global $smarty, $cart; //SET CARRIER IDs - TO NOT TO SHOW THIS COD MODULE (for example - 24 was POSTAL SERVICE, so COD is not needed. //ADD AS MANY IDs AS YOU WANT TO RESTRICT. if ($cart->id_carrier == 24) return ; } Is there anyone to help with this problem? Really appreciate it. Thank you Link to comment Share on other sites More sharing options...
vekia Posted December 28, 2016 Share Posted December 28, 2016 create carriers for selected regions ship2pay module associate carrier with payment method with these 3 steps you can: - associate cod payment with selected carriers so in effect, cod will be available for selected regions only. 1 Link to comment Share on other sites More sharing options...
jamshidpour Posted December 28, 2016 Author Share Posted December 28, 2016 Thank you dear Vekia for responding and the solution. Could you please give me an URL to ship2pay module? I have searched for it in BO/modules but i was unable to find it, also googled it and found a lot of results but was not sure which one is what you told. So i appreciate it if you give me URL to that module. Thanks a lot mate 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