Jo! Posted March 4, 2010 Share Posted March 4, 2010 Would be great if I could BIND Cash-On-Delivery PAYMENT only for certain zone. (Nobody sends goods 1000 miles far with courier... Especially if goods are NOT PAID YET) :-DAll we need is to make ONE CHECKBOX in COD configuration...Can anyone code this?===(it's possible to do this using GROUPS, but in this case we need to ADD CUSTOMERS TO A GROUP MANUALLY - not good solution) Link to comment Share on other sites More sharing options...
SpyrosT Posted March 4, 2010 Share Posted March 4, 2010 BO>>PaymentThen you can select under Countries restrictions the country or countries in which you want the COD be available. Link to comment Share on other sites More sharing options...
Jo! Posted March 4, 2010 Author Share Posted March 4, 2010 But I need to allow NOT THE COUNTRY, just ONE CITY in the country (where the stock is located).And REST PART of the country must be restricted. This must be done with ZONES (or states).This is especially for COURIER delivery. Courier delivery comes together with Cash-On-Delivery, isn't it.And YOU NEVER SEND COURIER TO ANOTHER CITY. Link to comment Share on other sites More sharing options...
SpyrosT Posted March 4, 2010 Share Posted March 4, 2010 Thats right create the city you want in the zones.Then you can select this new zone as mentioned in my previous post. Link to comment Share on other sites More sharing options...
Jo! Posted March 4, 2010 Author Share Posted March 4, 2010 ZONES are not shown and configuring on the Payments page. Link to comment Share on other sites More sharing options...
SpyrosT Posted March 4, 2010 Share Posted March 4, 2010 Then create a NEW Country but insert the name of the City;) Link to comment Share on other sites More sharing options...
Jo! Posted March 4, 2010 Author Share Posted March 4, 2010 No. This will not help.Because you need to bind it to customer address, delivery, carriers etc etc. Cities ARE cities, countries ARE countries.We need just a little coding here.So let's wait what coders say... Link to comment Share on other sites More sharing options...
Jo! Posted March 4, 2010 Author Share Posted March 4, 2010 So GUYS, you can modify your COD module like this: 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 ; This is the simpliest way. Of course, better to put some dialogues into module's interface - but don't have enough time and nervous to analyse all code. But this works too... ACTUALLY, COD MODULE without this is unusable. Because it acts "theoretically". I mean, THEORETICALLY you send goods by courier to another city. But PRACTICALLY - you do not (only of you have STOCK in that city). 1 Link to comment Share on other sites More sharing options...
navin Posted July 29, 2012 Share Posted July 29, 2012 So GUYS, you can modify your COD module like this: 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 ; This is the simpliest way. Of course, better to put some dialogues into module's interface - but don't have enough time and nervous to analyse all code. But this works too... ACTUALLY, COD MODULE without this is unusable. Because it acts "theoretically". I mean, THEORETICALLY you send goods by courier to another city. But PRACTICALLY - you do not (only of you have STOCK in that city). Hey Jo! Thanks for your code. Could you please let me know the code in case I want to restrict the cash on delivery module to certain postcodes (in billing address)? I am new to prestashop, so don't have very much idea about how this works. Link to comment Share on other sites More sharing options...
Harmeet Duggal Posted November 1, 2012 Share Posted November 1, 2012 Is this possible to allow instead of restrict in above code??? means allow for certain postal codes?? Link to comment Share on other sites More sharing options...
jamshidpour Posted December 28, 2016 Share Posted December 28, 2016 Hi, thx for the code. Could you please fix it for PS 1.6 ? because in prestashop 1.6, after adding this code to cashondelivery.php the blank page appears in Step 5 (payment options). Appreciate it 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