defuzed Posted August 27, 2014 Share Posted August 27, 2014 Hello, i'm trying to pass a variable defined in the validateOrder() function of the PaymentModule class into a custom payment module's hookPaymentReturn function. I thought i could achieve this through the $params array, unfortunately if i try to add a variable to the Hook::exec('actionValidateOrder', array(); it doesn't seem to get passed into the hookPaymentReturn. (if i d($params) in that function my variable doesnt appear). I'm obviously not good at php, help appreciated! Link to comment Share on other sites More sharing options...
bellini13 Posted August 27, 2014 Share Posted August 27, 2014 can you show the code you tried to use? Both in the PaymentModule and your modules hookPaymentReturn Link to comment Share on other sites More sharing options...
defuzed Posted August 27, 2014 Author Share Posted August 27, 2014 (edited) Hey Bellini, in PaymentModule->validateOrder() i used: // Hook validate order Hook::exec('actionValidateOrder', array( 'cart' => $this->context->cart, 'order' => $order, 'customer' => $this->context->customer, 'currency' => $this->context->currency, 'orderStatus' => $order_status, 'postUpload' => $post_upload //added by me $post_upload is a boolean )); which, as i gathered from other topics was where the hook got its $params from. and then in my modules hookPaymentReturn() i used: $has_post_upload = $params['postUpload']; to access the variable... what am i doing wrong? Edited August 27, 2014 by defuzed (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted August 27, 2014 Share Posted August 27, 2014 looks accurate, but where do you set $post_upload to true in the PaymentModule class? Also did you make the edit directly to PaymentModule, or did you do this via an override? 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