ZkpmklvreM Posted October 30, 2010 Share Posted October 30, 2010 I want to change module that allow to pay by cash on deliver.I need that presta show this method of payment only when summary price is in range 1-50$.How to do this?Thanks a lot in advance. Link to comment Share on other sites More sharing options...
rocky Posted October 31, 2010 Share Posted October 31, 2010 Change lines 44-47 of modules/cashondelivery/cashondelivery.php from: $smarty->assign(array( 'this_path' => $this->_path, 'this_path_ssl' => Tools::getHttpHost(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); to: $smarty->assign(array( 'this_path' => $this->_path, 'this_path_ssl' => Tools::getHttpHost(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/', 'total' => $params['cart']->getOrderTotal() )); Then change modules/cashondelivery/payment.tpl from: <a href="{$this_path_ssl}validation.php" 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;" /> {l s='Pay with cash on delivery (COD)' mod='cashondelivery'} {l s='You pay for the merchandise upon delivery' mod='cashondelivery'} to: {if $total <= 50} <a href="{$this_path_ssl}validation.php" 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;" /> {l s='Pay with cash on delivery (COD)' mod='cashondelivery'} {l s='You pay for the merchandise upon delivery' mod='cashondelivery'} {/if} Link to comment Share on other sites More sharing options...
ZkpmklvreM Posted October 31, 2010 Author Share Posted October 31, 2010 Big big thanks!!!But how to get $total in $ only (if I use Euro -> it don`t check the value) Link to comment Share on other sites More sharing options...
rocky Posted November 1, 2010 Share Posted November 1, 2010 So you only want to check the total when the currency is dollars? To do that, use the following: {if $cookie->id_currency|intval != 1 OR ($cookie->id_currency|intval == 1 AND $total <= 50)} Link to comment Share on other sites More sharing options...
ZkpmklvreM Posted November 1, 2010 Author Share Posted November 1, 2010 I wanted this:{if ($cookie->id_currency|intval == 1 AND $total<=43) OR ($cookie->id_currency|intval == 4 AND $total <= 30) OR ($cookie->id_currency|intval == 5 AND $total <= 60)} because different currency mean different value Thank you so much!!! Link to comment Share on other sites More sharing options...
cartman133 Posted November 16, 2010 Share Posted November 16, 2010 i hawe a problem. i want to charge product by wight like if it's to 2kg its 4,08€...sory for bed english. thx Link to comment Share on other sites More sharing options...
Riv3n Posted April 9, 2011 Share Posted April 9, 2011 Hello Rocky,I also wish to implement this changes on my store but for some reason I got a Blank Page after step2 ( no text, no nothing, no other payment modules) after editing the files modules/cashondelivery/cashondelivery.php and payment.tpl like you suggested.Can you please give a explanation of what I may have doing wrong ? I have copy and paste your code EXACTLY like you typed and I have PS Version 1.2.5.0.Thank youL.J Link to comment Share on other sites More sharing options...
rocky Posted April 9, 2011 Share Posted April 9, 2011 Uncomment the debug_backtrace() line in the displayError() function in classes/Tools.php. That will give you a stack trace instead of a blank page, which should help you trace the problem. Link to comment Share on other sites More sharing options...
Riv3n Posted April 11, 2011 Share Posted April 11, 2011 Hello Rocky, Thank you for your fast reply.The line you are referring to is this right ? Tools.php line 335 //d(debug_backtrace()); I have deleted the // and I don't have any error messages and still a blank page. I have a non English store and I am using the Portuguese translation files, could this be related ?Thank very much for your time and attention to this issue.Best RegardsL.J Link to comment Share on other sites More sharing options...
rocky Posted April 11, 2011 Share Posted April 11, 2011 Yep, that's the right line. Uncomment that should have resulted in a stack trace being displayed. Try editing config/config.inc.php and changing 'display_errors' from 'off' to 'on'. If that doesn't caused an error message to display, then I can't help you. 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