Hello All, I have been working on a Drupal offsite payment module. I want to display additional information related to order (like transaction id, merchant reference number etc that we get in response from gateway side)in the order completion message section. I have attached screenshot for reference.
What I did:
-> Created 'templates' folder inside root directory of my module & Override the "commerce-order-receipt.html.twig". The path is modules/commerce_latpay/templates/commerce-order-receipt.html.twig. Then cleared cache.
But the changes are not reflecting, not sure why? Can anyone guide me, what wrong am I doing and what is the correct way of achieving this?
what I know:
-> Please note I already know that the order completion message can be customised by editing the default checkout pane in "admin/commerce/config/checkout-flows/manage/" but I need to do this programmatically as this module is going to be published publicly for free in future.
I would greatly appreciate any help. Thanks in advance.
Comments
You may try to implement the
You may try to implement the hook_theme() in YOUR_MODULE.module file.
No change in order message
Hi, Thanks for the response. However I have already tried hook theme() , it doesn't make any change. The order messages is still same. Look at my .module file code;
I hope that you rebuild the
I hope that you rebuild the caches.
It's seems the 'template' => 'commerce-order-receipt', is redundant. Also, you may try to create the unique template by implementing the hook_theme_suggestions_HOOK().
yeah, I clear cache every
yeah, I clear cache every single I time modify the file. I also implemented the hook_theme_suggestions_HOOK(). Created unique templates too but nothing changes. I really don't understand what am I doing wrong. Here's my .module file code:
click here