Jump to content

[Solved] »Payment error« using a custom shipping module


babu_babu

Recommended Posts

Hi,

 

I built my own shipping module to apply custom shipping calculation using this module example:

http://www.prestasho...post__p__444652

 

I only changed meta information and the getOrderShippingCost() function to calculate the shipping fee. It worked great so far, but it seems that there is a conflict with the PayPal module.

Customers get a »Payment error« email from the shop and at the same time a payment confirmation from PayPal.

The money gets transfered but the order is marked with »Payment error« in the back office.

Shipping in the »Order details« box is set to 0, which does not happen with the »cheque« module (which itself works perfectly together with my shipping module).

 

What am I doing wrong?

 

PrestaShop: 1.4.3 (using »Payments by credit cards« and »Payment type« »Direct (sales)«)

PayPal Module: v2.8.5

 

Thanks a lot!

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

  • 4 months later...

I now updated the PayPal module to v3.0.6 and I'm using the sandbox.

 

But I'm still having the same issues.

 

What's wrong here? Is there a way to debug? Are there log files in Prestashop or in the PayPal Sandbox?

 

Thanks.

Link to comment
Share on other sites

  • 2 weeks later...

I now figured out, that this happened, because the shipping cost calculation didn't actually happen. the carrier of the new shipping module was visually checked already, but selecting the carrier triggers the calculation, which then didn't happen.

 

I fixed this (bug?) by changing this part of order-opc.js in my theme folder

 

 

if (carriers[i].is_module && !isLogged && !isGuest)
var extraHtml = 'disabled="disabled"';
else if (checkedCarrier == carriers[i].id_carrier || carriers.length == 1)
var extraHtml = 'checked="checked"';

 

to

 

 


if (carriers[i].is_module && !isLogged && !isGuest)
var extraHtml = 'disabled="disabled"';
else if (checkedCarrier == carriers[i].id_carrier || carriers.length == 1)
var extraHtml = 'checked="checked"';
else
var extraHtml = '';

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