TropischBruin Posted December 8, 2008 Share Posted December 8, 2008 There is a major issue with the payment en shipping modules in PrestaShop.The problem is that if I set-up my shop with 2 carriers (pickup and deliver) and 2 payment (cash on pickup and bankwire) I cannot force the carrier modules to only have 1 payment module.Lets say my customer chooses the deliver-carrier option, I want him to only have the Bankwire payment option and not the CasOnPickup.Same goes for any other set-up I create.In osCommerce we have Ship2Pay, we need such a thing for PrestaShop a.s.a.p.Or am I missing the point? Link to comment Share on other sites More sharing options...
TropischBruin Posted December 16, 2008 Author Share Posted December 16, 2008 BUMP!Is there no-one who recognize this problem? Link to comment Share on other sites More sharing options...
Merchant Posted December 22, 2008 Share Posted December 22, 2008 Hi TropischBruin,My guess is that we have to look in order.php and there combine those two items.I will give it some attention after the Xmass hollidays. Link to comment Share on other sites More sharing options...
TropischBruin Posted December 22, 2008 Author Share Posted December 22, 2008 Hi TropischBruin,My guess is that we have to look in order.php and there combine those two items.I will give it some attention after the Xmass hollidays. I'm not sure if this is want you want.I think a better solution is to have options within PS where you can use somethin like a dropdown box in the carrier configuration to choose:1. when left empty the carrier can be used with any payment module2. when set to cash-on-pickup it will only allow this payment module and nothing else.Thans anyway foor your time! Link to comment Share on other sites More sharing options...
ruilong Posted December 29, 2008 Share Posted December 29, 2008 I don't think there is room for this in prestashop now (not with a module atleast)but it should be possible to make some kind of check on the paymentmodule code and see what carrier is selected.you can get what you want, if you modify the payment module.$cart->id_carrier should be something you might want to check at Link to comment Share on other sites More sharing options...
TropischBruin Posted December 29, 2008 Author Share Posted December 29, 2008 I don't think there is room for this in prestashop now (not with a module atleast)but it should be possible to make some kind of check on the paymentmodule code and see what carrier is selected.you can get what you want, if you modify the payment module.$cart->id_carrier should be something you might want to check at OK, so the payment-modules should check on the carriers used.Hmm, that is not so easy to do (meaning that I'm no php-coder ;-) ).Adding a code I can, thinking on what code to use I cannot. Link to comment Share on other sites More sharing options...
Merchant Posted December 29, 2008 Share Posted December 29, 2008 Is it an idea to add the carrier and payment on the product page in the admin panel?Let's say you have a product X, a carrier Y and a payment Z.Now on the catalog> product page you choose the carrier and the payment that you want this product to have.So you can tell PS that you want product X only uses carrier Y and payment Z, product A can use carrier B and payment C, for example. Link to comment Share on other sites More sharing options...
TropischBruin Posted December 29, 2008 Author Share Posted December 29, 2008 Is it an idea to add the carrier and payment on the product page in the admin panel?Let's say you have a product X, a carrier Y and a payment Z.Now on the catalog> product page you choose the carrier and the payment that you want this product to have.So you can tell PS that you want product X only uses carrier Y and payment Z, product A can use carrier B and payment C, for example. That is to much of a hassle.Best is:Set: Carrier1 = payment1Set: Carrier2 = payment2Of no choice (set) is made then:carrier 1 = payment1 or payment2 Link to comment Share on other sites More sharing options...
Merchant Posted December 29, 2008 Share Posted December 29, 2008 Hhmmm..Ok, but i have some products like licenses, who can be payed after delivery (in dutch: op rekening)When the customer does'nt pay the bill, i allways can cancell the license.However, when a customer buys a solar panel, and he can pay after delivery, and he does'nt pay his bill then it is very difficult to get back my goods. When i can sat that the solar panel can be shipped by TNT and payed by iDeal, i have no risk. Link to comment Share on other sites More sharing options...
TropischBruin Posted December 29, 2008 Author Share Posted December 29, 2008 This you can do by using the weight (gewicht) of the product.A license weights nothing compared to a solarscreen Link to comment Share on other sites More sharing options...
Merchant Posted December 29, 2008 Share Posted December 29, 2008 Ok, i did not looked at this possibility yet Thx. :red:And it depends if you're talking about financial or natural weights. :-) Link to comment Share on other sites More sharing options...
Paul C Posted January 5, 2009 Share Posted January 5, 2009 I think this is only possible (currently) by editing the payment modules. In effect you could choose not to display a payment option if a particular carrier has been selected (using a hard-coded carrier_id).In payment modules there is always a hookPayment() function which displays the payment method. Within this function you would do your test for the carrier.So, for example if someone has picked a carrier that takes payment on delivery, you don't want to allow payment by PayPal to be an option. In paypal.php (line 139) there is: public function hookPayment($params) { global $smarty; $address = new Address(intval($params['cart']->id_address_invoice)); $customer = new Customer(intval($params['cart']->id_customer)); $business = Configuration::get('PAYPAL_BUSINESS'); $currency = $this->getCurrency(); etc.Lets's say your cash on delivery carrier has the id of 2, then you could change the above to: public function hookPayment($params) { global $smarty; $cart = new Cart(intval($params['cart'])); if (intval($cart->id_carrier==2)) return; $address = new Address(intval($params['cart']->id_address_invoice)); $customer = new Customer(intval($params['cart']->id_customer)); $business = Configuration::get('PAYPAL_BUSINESS'); $currency = $this->getCurrency(); This will disable PayPal for any checkout processes where the customer has selected the carrier with the ID of 2.A bit messy, but it would provide a quick fix.Paul Link to comment Share on other sites More sharing options...
TropischBruin Posted January 6, 2009 Author Share Posted January 6, 2009 I think this is only possible (currently) by editing the payment modules. In effect you could choose not to display a payment option if a particular carrier has been selected (using a hard-coded carrier_id).A bit messy, but it would provide a quick fix.Paul Paul, this will do I'll guess.I will testrun tonight.Thanks! Link to comment Share on other sites More sharing options...
ToysStore Posted January 6, 2009 Share Posted January 6, 2009 Hi Paul, I have tried this little tweak but it seems not to work.Did you actually test it? Never mind i found it Link to comment Share on other sites More sharing options...
sassur Posted January 20, 2009 Share Posted January 20, 2009 Hi.I have made a patch that enable Payment restrictions depending on the carrier.Download it from http://alphaspel.se/prestashop/patches/Payment_Carriers_restrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.Best regards Fredrik Link to comment Share on other sites More sharing options...
Ehinarr Posted January 21, 2009 Share Posted January 21, 2009 Hi.I have made a patch that enable Payment restrictions depending on the carrier.Download it from http://alphaspel.se/prestashop/patches/Payment_Carriers_restrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.Best regards Fredrik Fantastic!! Nice work.Thanks a lot. Yuppyyyy!! Link to comment Share on other sites More sharing options...
trinigemini Posted January 22, 2009 Share Posted January 22, 2009 Hi.I have made a patch that enable Payment restrictions depending on the carrier.Download it from http://alphaspel.se/prestashop/patches/Payment_Carriers_restrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.Best regards Fredrik hey...i downloaded this patch...and followed the README.txt file...and im applying the patch after the installation bcuz i had prestashop installed and everything already...BUT there's one part i dont understand..."Then add the table found in module_carrier.sql to the database, do not forgett to change PREFIX."Please explain what this means...thanks so much Link to comment Share on other sites More sharing options...
TropischBruin Posted January 22, 2009 Author Share Posted January 22, 2009 hey...i downloaded this patch...and followed the README.txt file...and im applying the patch after the installation bcuz i had prestashop installed and everything already...BUT there's one part i dont understand..."Then add the table found in module_carrier.sql to the database, do not forgett to change PREFIX."Please explain what this means...thanks so much This is done via phpMyAdmin. Link to comment Share on other sites More sharing options...
tintacreative Posted January 31, 2009 Share Posted January 31, 2009 i got it right tho, and thanks a lot for this great applications.For those who dont know how to upload the module_carrier.sql. These are the steps1. Login into your cpanel2. Click on phpmyadmin3. On the left side, click on the database you use for your prestashop.4. You can see list of tables on your left, and then on top, click import tabs.5. Before you import the table, take a look at the prefix used by all the tables inside your database, and open the module_carrier.sql using notepad.6. Change CREATE TABLE `PREFIX_module_carrier` PREFIX to the correct prefix used by your tables, in my case the prefix is ps_, so i change it to CREATE TABLE `ps_module_carrier`.7. Save it.8. At the import tab, browse the file, and click go.9. Then everything should be ok.Thanks again to the creator. Link to comment Share on other sites More sharing options...
sassur Posted February 1, 2009 Share Posted February 1, 2009 Thanks tintacreative for the description of getting the modifications into the database. Link to comment Share on other sites More sharing options...
MonDeveloper Posted May 20, 2009 Share Posted May 20, 2009 hi Guys !!!Great Module !!!Unfortunately when I need it i haven't found this thread so I realize my own module ! :-(Your version is surely cooler but I have a different approach when realize modules, my first rule is "IF I CAN I DON'T CHANGE DB OR EXISTING PS CORE FILE".So my works often doesn't fit perfectly the customer need but it's really transparent and don't create issues when you update your shop.If you want to test my module this is the link.The thread is in Italian but the downloadable module has been developed in English (someone has translated it in Spanish).Enjoy it !mM Link to comment Share on other sites More sharing options...
Hoodgrown Posted May 20, 2009 Share Posted May 20, 2009 are you going to offer your mod as well for download? Having alternatives never hurts! Link to comment Share on other sites More sharing options...
MonDeveloper Posted May 22, 2009 Share Posted May 22, 2009 SURE ! :coolsmile: If you follow this link you can find the original (Italian) thread where you can download the module!But nothing new, you can download the same file yesterday too, the same link was present in my previous post, something wrong?I know the thread is in italian but trust me, download the file attached to the first post and you'll find the instruction in Inglish in the package!Enjoy it! Link to comment Share on other sites More sharing options...
first1 Posted May 24, 2009 Share Posted May 24, 2009 -can this be made as carrier restriction for certain user group instead? (i mean the customers groups in 1.2 alfas) Link to comment Share on other sites More sharing options...
MonDeveloper Posted May 24, 2009 Share Posted May 24, 2009 I don't know, at the moment i haven't time to study the new 1.2 release but if you take a look to my module maybe you find the solution!...sorry!if you build your own module or change mine please, SHARE it !have a nice Shop!mM Link to comment Share on other sites More sharing options...
fkeuning Posted June 5, 2009 Share Posted June 5, 2009 Hi Paul,I have tried this little tweak but it seems not to work.Did you actually test it? Never mind i found it What did you find? I tried this too. I get the wrong payment option to disappear. But it also doesn't appear when I do need it. Can you give me a hint? Link to comment Share on other sites More sharing options...
Ehinarr Posted August 16, 2009 Share Posted August 16, 2009 Hi sassur.I like your solution to restrict the carriers because it can manage all the modules of payment and not just one.Is there any chance of making it work in PS 1.2.1?I followed the instructions of the diff file and run it on PS 1.2.1 with sucess, but still there is a problem: After the purchase, the order-confirmation.tpl file is shown several times. If there are 6 carriers for the module, the order-confirmation.tpl file is shown 6 times. Link to comment Share on other sites More sharing options...
nizo Posted December 8, 2009 Share Posted December 8, 2009 Hi.I have made a patch that enable Payment restrictions depending on the carrier.Download it from http://alphaspel.se/prestashop/patches/Payment_Carriers_restrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.Best regards Fredrik is it working with presta 1.2.4 too? or only for 1.1. - i found answer one post later.... sorry Link to comment Share on other sites More sharing options...
roberta Posted February 2, 2010 Share Posted February 2, 2010 Link does not function more. Would somebody have this archive to resend?Grateful. Link to comment Share on other sites More sharing options...
tk007 Posted May 22, 2010 Share Posted May 22, 2010 Hi roberta,You can found it here :http://www.prestashop.com/forums/viewthread/16030/svenska/lsa_vissa_betalmoduler_till_en_viss_transportrTack till svenska forumettk007 Link to comment Share on other sites More sharing options...
roberta Posted May 22, 2010 Share Posted May 22, 2010 Hi roberta,You can found it here :http://www.prestashop.com/forums/viewthread/16030/svenska/lsa_vissa_betalmoduler_till_en_viss_transportrTack till svenska forumettk007 Thank you very much. Link to comment Share on other sites More sharing options...
mrk1987 Posted May 22, 2010 Share Posted May 22, 2010 I downloaded this patch…and followed the README.txt file…and im applying the patch after the installation Link to comment Share on other sites More sharing options...
tk007 Posted June 3, 2010 Share Posted June 3, 2010 HOHO...I'm working with version 1.3.1 of Prestashop and this excellent module is not working anymore.Can someone resolve this problem ?Byetk007 Link to comment Share on other sites More sharing options...
Samantha Nunes Posted August 11, 2010 Share Posted August 11, 2010 Hi Paul,I have tried this little tweak but it seems not to work.Did you actually test it? Never mind i found it One more suggestion:http://www.prestashop.com/forums/viewthread/28286/modules_tiers/mise_a_disposition_de_2_modules (module 2: stiffmodulecarrier)Enjoy! Link to comment Share on other sites More sharing options...
Samantha Nunes Posted August 11, 2010 Share Posted August 11, 2010 Hi.I have made a patch that enable Payment restrictions depending on the carrier.Download it from http://alphaspel.se/prestashop/patches/Payment_Carriers_restrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread.Best regards Fredrik One more suggestion:http://www.prestashop.com/forums/viewthread/28286/modules_tiers/mise_a_disposition_de_2_modules (module 2: stiffmodulecarrier)Enjoy! Link to comment Share on other sites More sharing options...
newage Posted April 5, 2013 Share Posted April 5, 2013 Hi. I have made a patch that enable Payment restrictions depending on the carrier. Download it from http://alphaspel.se/...estrictions.zip there is a README.txt inside. If there is any questions please ask them in this thread. Best regards Fredrik Where is the patch? I have the same problem with carier. Link to comment Share on other sites More sharing options...
newage Posted April 5, 2013 Share Posted April 5, 2013 I think this is only possible (currently) by editing the payment modules. In effect you could choose not to display a payment option if a particular carrier has been selected (using a hard-coded carrier_id). In payment modules there is always a hookPayment() function which displays the payment method. Within this function you would do your test for the carrier. So, for example if someone has picked a carrier that takes payment on delivery, you don't want to allow payment by PayPal to be an option. In paypal.php (line 139) there is: public function hookPayment($params) { global $smarty; $address = new Address(intval($params['cart']->id_address_invoice)); $customer = new Customer(intval($params['cart']->id_customer)); $business = Configuration::get('PAYPAL_BUSINESS'); $currency = $this->getCurrency(); etc. Lets's say your cash on delivery carrier has the id of 2, then you could change the above to: public function hookPayment($params) { global $smarty; $cart = new Cart(intval($params['cart'])); if (intval($cart->id_carrier==2)) return; $address = new Address(intval($params['cart']->id_address_invoice)); $customer = new Customer(intval($params['cart']->id_customer)); $business = Configuration::get('PAYPAL_BUSINESS'); $currency = $this->getCurrency(); This will disable PayPal for any checkout processes where the customer has selected the carrier with the ID of 2. A bit messy, but it would provide a quick fix. Paul $cart->id_carrier is always 2 no matther what carrier I select. How can I get the real carrier ID? Link to comment Share on other sites More sharing options...
janoo Posted September 22, 2014 Share Posted September 22, 2014 I think this is only possible (currently) by editing the payment modules. In effect you could choose not to display a payment option if a particular carrier has been selected (using a hard-coded carrier_id). In payment modules there is always a hookPayment() function which displays the payment method. Within this function you would do your test for the carrier. So, for example if someone has picked a carrier that takes payment on delivery, you don't want to allow payment by PayPal to be an option. In paypal.php (line 139) there is: public function hookPayment($params) { global $smarty; $address = new Address(intval($params['cart']->id_address_invoice)); $customer = new Customer(intval($params['cart']->id_customer)); $business = Configuration::get('PAYPAL_BUSINESS'); $currency = $this->getCurrency();etc. Lets's say your cash on delivery carrier has the id of 2, then you could change the above to: public function hookPayment($params) { global $smarty; $cart = new Cart(intval($params['cart'])); if (intval($cart->id_carrier==2)) return; $address = new Address(intval($params['cart']->id_address_invoice)); $customer = new Customer(intval($params['cart']->id_customer)); $business = Configuration::get('PAYPAL_BUSINESS'); $currency = $this->getCurrency(); This will disable PayPal for any checkout processes where the customer has selected the carrier with the ID of 2. A bit messy, but it would provide a quick fix. Paul This method is also working in PS 1.6 but with little modification: in choosen payment module php find: public function hookPayment($params) { if (!$this->active) return; ... ... and change to public function hookPayment($params) { if (!$this->active) return; // custom deactivation for CashOnPickup $id_carrier = (int)$this->context->cart->id_carrier; if (intval($id_carrier==3)) // use your choosen carrier id return; ... ... Id of carrier you can easy find in Administration (BO) > Shipping > Carriers 1 Link to comment Share on other sites More sharing options...
myselfidem Posted October 17, 2014 Share Posted October 17, 2014 (edited) Hello, Thanks janoo. Tested and works fine. Maybe you would try this FREE Addons, tested on PrestaShop 1.6.0.6 and works fine, even if it's for PrestaShop 1.5. You can download the free module, unzip the zip file and you will find two versions. I choosen "ShipToPay version 1.5" http://addonspresta.com/en/free-modules/48-ship-to-pay.html Regards Edited October 22, 2014 by myselfidem (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts