Jump to content

20% down payment


Recommended Posts

I use Prestashop 1.4.4 and I want to make the customer pay 20% deposit upon order with payment on delivery. Is there a module that will calculate 20% of the order and displays the bank account number, which you need to make a transfer?

Link to comment
Share on other sites

Of course I was looking on google, but have not found anything on this subject.

I do not really know much about programming, so I wrote on the forum. I thought someone has already solved this problem and has a ready-made solution.

Link to comment
Share on other sites

  • 3 weeks later...

I'm trying to solve the problem by copying the module Bankwire. The problem arose after the approval of the contract, when displaying the amount and data to transfer. I can not set the amount to transfer = 20% value of order. Original fragments of code:

 

in php file:

public function hookPaymentReturn($params)
{
 if (!$this->active)
  return ;
 global $smarty;
 $state = $params['objOrder']->getCurrentState();
 if ($state == _PS_OS_BANKWIRE_ OR $state == _PS_OS_OUTOFSTOCK_)
  $smarty->assign(array(
   'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false),
   'bankwireDetails' => nl2br2($this->details),
   'bankwireAddress' => nl2br2($this->address),
   'bankwireOwner' => $this->owner,
   'status' => 'ok',
   'id_order' => $params['objOrder']->id
  ));
 else
  $smarty->assign('status', 'failed');
 return $this->display(__FILE__, 'payment_return.tpl');
}

 

in tpl file

- {l s='an amount of' mod='bankwire'} <span class="price">{$total_to_pay}</span>

 

When I change the code in the tpl file to this:

- {l s='an amount of' mod='bankwire'} <span class="price">{displayPrice price=$total_to_pay*0.2}</span>

 

Amount displayed is rounded down, for example:

value of order: $ 37.68

'total_to_pay': $ 37.00

20% down payment: $ 7.40

 

What should I change to the value of 'total_to_pay' is equal to the value of the order?

Link to comment
Share on other sites

  • 3 weeks later...
  • 5 weeks later...
  • 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...