Jump to content

[SOLVED] Question on Cash On Delivery (COD) module


wallchopz

Recommended Posts

Hi,

 

I enabled Cash On Delivery as payment for my customers. Let's say a customer places an order with a total amount of $230.28. But he chooses to pay through Cash On Delivery. Basically, he will be paying when the item he ordered will be delivered to him. But I notice on the order details on prestashop's admin interface under the payment table that there is already a payment of $230.28. It automatically puts it in after the customer places the order. (Please see attached photo to better understand what I'm trying to say.)

 

Is there a way to set that to $0 for Cash On Delivery payments?

 

post-800399-0-62654800-1407919911_thumb.jpg

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

this requires a change to the COD module.  I assume you are using v0.7.3 from Prestashop?

 

In the module folder you will find \controllers\front\validation.php.  Edit this and look for line 59 which should have this content

$this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key);

Change it to this... you are  replacing $total with 0

$this->module->validateOrder((int)$this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), 0, $this->module->displayName, null, array(), null, false, $customer->secure_key);

Be advised that the order status will be "Payment Error", as Prestashop expects the total to be equal to the order amount.  In this case, the total will not equal the order amount, and there will be a problem.

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

and how can we solve the payment error , I do not want en email going to the customer with payment error

but the customer did not pay for this item yet, so if you want the payment amount to reflect 0, and not match the order amount, then you should expect a payment error until they do pay.

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