Jump to content

how to override the file paypal\paypal_orders.php?


Jorbel

Recommended Posts

module: https://github.com/PrestaShop/paypal

I'm trying to override the class PayPalOrder (paypal\paypal_orders.php), I copied the entire file to
\override\modules\paypal\paypal_orders.php

I renamed the class in this way:

class PayPalOrderOverride extends PayPalOrder { .... }

and I modified the content of the function
public static function getTransactionDetails($ppec = false, $payment_status = false);

because I got an error: PHP Notice: Undefined index: PAYMENTREQUEST_0_SHIPPINGAMT
when I try to confirm a payment using Paypal.
Alter that, I removed all cache directory content but it doesn't work.

what should I do to override this class?

Link to comment
Share on other sites

Thanks guys, I just was trying to put this code:

if (!isset($ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'])) {
     $ppec->result['PAYMENTREQUEST_0_SHIPPINGAMT'] = 0;
}

inside the getTransactionDetails function because I got an error when tried to do a Payment using Paypal.

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