Jump to content

[solved] Enable COD module for minimum amount


Recommended Posts

in second thread i pasted the solution, i decided to put it also here:

 

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

it should be like if the product amount is above 25000... i mean if there are two product which cost 15000 each so total becomes 30000 and it is above 25000 i don't want COD to be available for this ... if only one product has a value 25000 or above COD should be available i hope i am clear with my question....

Link to comment
Share on other sites

but if you will have several products then how you want to use correct value of the amount?

without core modification there is no possibility to do this.

 

why you don't want to use cart amount? it's strictly related to the products value

Link to comment
Share on other sites

actually its easy monthly installment option.. and it applicable for product which has price above 25000... and that price should be for single product not the total price of all the products.... did you understand my problem...

Link to comment
Share on other sites

can you test this:

 

{assign var="ver" value="0"}
{foreach from=$cart->getproducts() item=prd}
   {if $prd['price'] > 25000}
    {$ver="1"}
   {/if}
{/foreach}
{if !$ver==1}
<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}

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Hello. The solution

{if $cart_qties->value>999}
code here
{/if}

in payment.tpl works good for me. I use the code above to "display:none" the cashondelivery over 999 €.  The problem is that if I go to

http://www.mysite.com/modules/cashondeliveryfee/validation.php I can reach the final page with cashondelivery and confirm the order, because the condition it's only a "graphic" correction for displaying or not cash on delivery link.

 

 How can solve this ?

Thanks.

Edited by rob84 (see edit history)
Link to comment
Share on other sites

  • 6 months later...
×
×
  • Create New...