Reputation: 127
I have one problem regarding module override. I have created my custom payment module for learning purpose and now I want to change cart amount to total placed order. But
$this->module->validateOrder
gives error for amount. Is there any way to override validateOrder function of PaymentModuleCore class ?
Upvotes: 0
Views: 4357
Reputation: 157
You can create your own class and override the function, for example :
class MyPaymentModule extends PaymentModule
{
public function validateOrder($id_cart, $id_order_state, $amount_paid, $payment_method = 'Unknown', $message = null, $extra_vars = array(), $currency_special = null, $dont_touch_amount = false, $secure_key = false, Shop $shop = null)
{
// your code
}
}
And your module extends MyPaymentModule, not PaymentModule.
Upvotes: 1