sadaf Posted July 18, 2013 Share Posted July 18, 2013 I want to enable cash on delivery module on minimum amount of 25000 how can i achive this??? i saw this post (http://www.prestasho...hipping-method/)but did not understand anything on were to add the code to..... Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 it mean that you have to edit the php / tpl file of this module, where you need to add simple if condition checking the amount Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 can you just help me with what exactly i have to write?? n were it has to be>? please Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 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 More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 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 More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 so change the {if $cart_qties->value>25000} to {if $cart_qties->value<25000} Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 i am talking about the unit price of the product!! not the total price or quantity... Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 i tried doing this dint work though... {if $product.unit_price->value>25000} code here {/if} Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 i replied in another thread related to this case, believe me it work but you have to use correct sign "<" not ">" Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 you gave me this option {if $cart->getordertotal()>25000} {/if} but i am asking something else bro... can you replace the "getordertotal" with "unit price" or something>? Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 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 More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 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 More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 I want to give this option if the buyer buys a single product of 25000 price or above.... Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 without core modification it isn't possible, in this case you have to edit the order core Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 im going to check the sources styp by step, please give me another chance Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 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} 1 Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 (edited) no it doesn't work if there is at least one product in the list which has price above 25000 then the module should work.. any luck?? Edited July 19, 2013 by sadaf (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 i checked this on my demo store and it works, foreach loop checking products one by one, if price of the product is bigger than 25000 then payment method doesnt appear i checked it on 1.5.4.1 Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 i want it to appear if the product price is above 25000 Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 so change the {if !$ver==1} to {if $ver==1} 1 Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 okie i will try and be back Link to comment Share on other sites More sharing options...
sadaf Posted July 19, 2013 Author Share Posted July 19, 2013 Thanks a lott vekia you made my day your really awesome in this forum thanks once again Link to comment Share on other sites More sharing options...
vekia Posted July 19, 2013 Share Posted July 19, 2013 you're welcome i just want to say: thank you for your patience i marked thread as [sovled] 1 Link to comment Share on other sites More sharing options...
rob84 Posted October 10, 2013 Share Posted October 10, 2013 (edited) 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 January 30, 2014 by rob84 (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 11, 2013 Share Posted October 11, 2013 do the same with validation.php file, i mean add there if conditions to check order value Link to comment Share on other sites More sharing options...
Amityadu Posted May 1, 2014 Share Posted May 1, 2014 (edited) Hi All, What I have to write if I want this option for particular country. Thanks In Advance Edited May 31, 2014 by Amityadu (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 1, 2014 Share Posted May 1, 2014 you mean that you want to create restriction like: - when someone order X products (based on value) from category Y - then disable module? Link to comment Share on other sites More sharing options...
Amityadu Posted May 2, 2014 Share Posted May 2, 2014 (edited) No Vekia, I want to activate this options only for few country. Thanks Edited May 31, 2014 by Amityadu (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts