xmitman Posted June 3, 2013 Share Posted June 3, 2013 Can anyone help me. Is there a way to set a minimum order amount based on payment or shipping method? For instance, I ship many items using COD. But there is a drawback to COD that I'm sure many experience. I have roughly 15% of my customers who do not accept the package because they don't have the money anymore by the time the package is delivered. I'm still responsible to pay the shipping fee but also the fee to return the item back to me. I would like to limit my losses by only offering COD on orders of $100 or more. Another possible way to limit losses is to charge the customer upfront for the shipping fees to be paid by Paypal. Once the shipping fees are paid, I then ship the order by COD for just the order total without any shipping fees. Similarly, on Bank Wire Transfers, my bank charges an incoming bank wire fee. Is there a way to pass this fee along when the customer chooses this payment method? Can anyone help me with these issue? Link to comment Share on other sites More sharing options...
bellini13 Posted June 5, 2013 Share Posted June 5, 2013 you would alter the COD module, in the hookpayment function, add the following pseudo code if cart amount < 100, then return false This will prevent the COD payment method from appearing during checkout if the cart amount is less then $100 As for the bank wire fee, you should search the forums as the community has already provided modules that allow you to charge fees based on the payment method. Link to comment Share on other sites More sharing options...
xmitman Posted June 5, 2013 Author Share Posted June 5, 2013 Thanks again Bellini13 for all of your help. Link to comment Share on other sites More sharing options...
sadaf Posted July 18, 2013 Share Posted July 18, 2013 were to add that code and how? please i need that.. please help.... Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 hello you have to edit .tpl / .php file of COD module, put it to the file / function related to the hookpayment 1 Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 thank you for your reply Vekia, But i don't understand were in tpl and php i have to add this... i tried doing it the page stops appearing if (cart amount < 100) return false; i added the code like this is it proper?? Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 go to the modules/cashondelivery/views/templates/hook/payment.tpl you have to use if condition: {if $cart_qties->value>25000} code here {/if} final code of the file: {if $cart_qties->value>25000} <p class="payment_module"> <a href="{$link->getModuleLink('cashondelivery', 'validation', [], true)}" title="{l s='Pay with cash on delivery (COD)' mod='cashondelivery'}"> <img src="{$this_path}cashondelivery.gif" alt="{l s='Pay with cash on delivery (COD)' mod='cashondelivery'}" style="float:left;" /> <br />{l s='Pay with cash on delivery (COD)' mod='cashondelivery'} <br />{l s='You pay for the merchandise upon delivery' mod='cashondelivery'} <br style="clear:both;" /> </a> </p> {/if} Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 Thanks a lot Vekia your awesome i will try this code and get back if it works out for me thanks thanks thanks Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 one more question you're talking about cart value or about products quantity? im asking because i used value of the products quantity Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 hmmm... it didn't work... even if the cart amount was more than 25000 COD did not appear Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 i am talking about the amount of the product... if the product purchased has a amount above 25000 then COD should be available els disabled.. i hope i am clear now>? Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 so you're talking about cart value, sorry for my misunderstanding, i pasted solution for quantity wait a sec Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 but i want the product value not the cart... i want to concentrate on single product rather the whole total value of the cart..... Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 use this if condition: {if $cart->getordertotal()>25000} {/if} Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 it see if the cart total is 25000 i want to see if there is a product which is worth 25000 Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Share Posted July 19, 2013 so you're talking about cart value, sorry for my misunderstanding, i pasted solution for quantity wait a sec but i want to add total of single product than whole cart total.... Link to comment Share on other sites More sharing options...
kenkomuri Posted August 6, 2013 Share Posted August 6, 2013 What about PayPal? I would like to set a minimum of 100 USD of the order. If the condition does not met then the payment method by PayPal should not appear as an payment option. Could you help me? Link to comment Share on other sites More sharing options...
freemall Posted April 12, 2014 Share Posted April 12, 2014 Hi Sir this is my code it is not working i am using prestashop 1.6 {if Cart::getOrderTotal()>999}<p class="payment_module"> <a href="{$link->getModuleLink('cashondelivery', 'validation', [], true)|escape:'html'}" title="{l s='Pay with cash on delivery (COD)' mod='cashondelivery'}" rel="nofollow"> <img src="{$this_path_cod}cashondelivery.gif" alt="{l s='Pay with cash on delivery (COD)' mod='cashondelivery'}" style="float:left;" /> <br />{l s='Pay with cash on delivery (COD)' mod='cashondelivery'} <br />{l s='You pay for the merchandise upon delivery' mod='cashondelivery'} <br style="clear:both;" /> </a></p>{/if} please help my site is qyntra.com thanks Link to comment Share on other sites More sharing options...
bellini13 Posted April 12, 2014 Share Posted April 12, 2014 put your code in the modules hookpayment function instead Link to comment Share on other sites More sharing options...
freemall Posted April 12, 2014 Share Posted April 12, 2014 thanks for reply help me where to put this public function hookPayment($params) { if (!$this->active) return ; global $smarty; // Check if cart has product download foreach ($params['cart']->getProducts() AS $product) { $pd = ProductDownload::getIdFromIdProduct((int)($product['id_product'])); if ($pd AND Validate::isUnsignedInt($pd)) return false; } $smarty->assign(array( 'this_path' => $this->_path, //keep for retro compat 'this_path_cod' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); } Link to comment Share on other sites More sharing options...
vekia Posted April 12, 2014 Share Posted April 12, 2014 code that i attached is a smarty code, not a code from .php file where you pasted this code before? what happened? some errors? Link to comment Share on other sites More sharing options...
freemall Posted April 12, 2014 Share Posted April 12, 2014 Dear Sir, this code is in /modules/cashondelivery/cashondelivery.php please guide me previously i modified modules/cashondelivery/views/templates/hook/payment.tpl nothing happen Link to comment Share on other sites More sharing options...
bellini13 Posted April 13, 2014 Share Posted April 13, 2014 public function hookPayment($params) { if (!$this->active) return ; if ($params['cart']->getOrderTotal()<999) return ; global $smarty; // Check if cart has product download foreach ($params['cart']->getProducts() AS $product) { $pd = ProductDownload::getIdFromIdProduct((int)($product['id_product'])); if ($pd AND Validate::isUnsignedInt($pd)) return false; } $smarty->assign(array( 'this_path' => $this->_path, //keep for retro compat 'this_path_cod' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); } If the cart amount is less than 999, then the payment module will return and will not show up as a payment method 2 Link to comment Share on other sites More sharing options...
freemall Posted April 13, 2014 Share Posted April 13, 2014 Thanks Dear bellini it is solved thanks again Sir. Link to comment Share on other sites More sharing options...
freemall Posted April 13, 2014 Share Posted April 13, 2014 Dear Sir, is it possible to select different payment module for different payments e.g. I want to select one payment method for debit card, another for credit card. thanks Link to comment Share on other sites More sharing options...
bellini13 Posted April 13, 2014 Share Posted April 13, 2014 i suppose you need to find a module that would do this Link to comment Share on other sites More sharing options...
Afropawn Posted December 22, 2014 Share Posted December 22, 2014 (edited) Hi, thanks for info.. very usefull.. i also put line showing a message like "Can't choose this method because your cart total is not enough" when method payment is not showed.. not so much.. but usefull for me, because i use it with one delivery method created only for cashondelivery, and this have this option.. if ($params['cart']->getOrderTotal()<999) return ('Cant choose this method because your cart total is not enough'); Other line i added is maximum amount.. the only change is symbol "<" to ">" if ($params['cart']->getOrderTotal()>2500) return ('Cant choose this method because your cart total exceed the maximum amount.'); Thanks again!! Edited December 22, 2014 by Afropawn (see edit history) Link to comment Share on other sites More sharing options...
rololo88 Posted December 17, 2015 Share Posted December 17, 2015 Hi, thanks for info.. very usefull.. i also put line showing a message like "Can't choose this method because your cart total is not enough" when method payment is not showed.. not so much.. but usefull for me, because i use it with one delivery method created only for cashondelivery, and this have this option.. if ($params['cart']->getOrderTotal()<999) return ('Cant choose this method because your cart total is not enough'); Other line i added is maximum amount.. the only change is symbol "<" to ">" if ($params['cart']->getOrderTotal()>2500) return ('Cant choose this method because your cart total exceed the maximum amount.'); Thanks again!! Thanks all for this, it solve my problem as well. Is it possible to make some 'decoration' for the text 'Cant choose this method because your cart total exceed the maximum amount.' to make it prettier on the website and also to translate it in several languages? Thank you in advance Link to comment Share on other sites More sharing options...
rololo88 Posted December 17, 2015 Share Posted December 17, 2015 (edited) I have another question, instead of unhook the payment module, will it be possible to just make it unclikable and keep the same text Afropawn added? Thanks again... Edited December 17, 2015 by rololo88 (see edit history) Link to comment Share on other sites More sharing options...
jjryeste Posted July 13, 2016 Share Posted July 13, 2016 Hello is posible in module cheque in modules\cheque\views\templates\front payment_execution.tpl i change {if isset($nbProducts) && $nbProducts <= 0} <p class="warning">{l s='Your shopping cart is empty.' mod='cheque'}</p>{else} <= 0} for <= 3} and Minimum product purchase is 3 i need change valuer quantity products for value price type example {if $getOrderTotal <= 14} <p class="warning">{l s='FOR THIS METHOD OF PAYMENT MUST BE OVER 14 EUROS.'}</p>{else} help please Link to comment Share on other sites More sharing options...
Iriathen Posted May 6, 2018 Share Posted May 6, 2018 Why is ti that that although posts are to solve problems yet solutions are given in pieces...? An other example where the post is kind of solved yet no full and clear solution is given! 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