Jump to content

Minimum order amount based on COD, payment or shipping method


Recommended Posts

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

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

  • 1 month later...

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 :mellow:

if (cart amount < 100)
return false;

 

i added the code like this is it proper??

Link to comment
Share on other sites

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

  • 3 weeks later...
  • 8 months later...

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

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

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

  • Like 2
Link to comment
Share on other sites

  • 8 months later...

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 by Afropawn (see edit history)
Link to comment
Share on other sites

  • 11 months later...

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

  • 6 months later...

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

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...