Jorbel Posted January 9, 2019 Share Posted January 9, 2019 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 More sharing options...
tdsoft Posted January 10, 2019 Share Posted January 10, 2019 Prestashop only allow override a classes, controller from Prestashop's Core you can NOT override class, controller from a module Link to comment Share on other sites More sharing options...
JBW Posted January 10, 2019 Share Posted January 10, 2019 Sure you can override module classes, check http://build.prestashop.com/howtos/module/how-to-override-modules/ Guess the error posted above is caused by some code inside your function override. Link to comment Share on other sites More sharing options...
joseantgv Posted January 10, 2019 Share Posted January 10, 2019 You can only override MAIN module class, in this case Paypal (paypal/paypal.php). Check this: Link to comment Share on other sites More sharing options...
JBW Posted January 10, 2019 Share Posted January 10, 2019 Thanks @joseantgvThats correct, only main class. Maybe @Jorbel can explain what he wants to achieve with his override!? Link to comment Share on other sites More sharing options...
Jorbel Posted January 15, 2019 Author Share Posted January 15, 2019 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now