Jump to content

[SOLVED] Change Pay On Deliver module


Recommended Posts

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

  • 2 weeks later...
  • 4 months later...

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 you

L.J

Link to comment
Share on other sites

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 Regards
L.J

Link to comment
Share on other sites

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

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...