Questions about Payment Form extension

Display extra options in payment method

More
1 month 2 weeks ago #169491 by Jibon
Hi,

I'm trying to develop one custom payment method where I want to list user's previous cards list but I wasn't able to figure it out from existing code. During final page under the payment title I want to list those cards dynamically. I can see there have one method getLayoutPath in administrator/components/com_pmform/libraries/osf/payment/common.php line 260 but in layout components/com_pmform/View/Form/tmpl/form_payment_methods.php only rendering title of the payment method. I didn't see in anywhere getLayoutPath was called. Having such type of options will be better to have so that we can extend and display other fields easily.

Thanks

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #169497 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display extra options in payment method
I'm unsure what is the final payment page you are talking about. Could you please give me more information ?

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #169501 by Jibon
Replied by Jibon on topic Display extra options in payment method
Sorry, I was meaning frontend form page where payment options, Term and Condition and Process Payment button display. When user select payment method during that time want to show previous cards list under payment method name.

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #169502 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display extra options in payment method
You should modify the code in the file components/com_pmform/View/Form/tmpl/form_payment_methods.php to show the cards list there. Make it hidden unless the payment method is selected

When payment method changed, Payment form dispatch javascript custom event:
Code:
// Dispatch event document.dispatchEvent(new CustomEvent("onPMFAfterPaymentMethodChange", { detail: { paymentMethod: paymentMethod } }));

You will need to write javascript code to handle that event trigger to show the cards list container if the payment method is selected, similar as how we handle it in media/com_pmform/assets/js/paymentform.js , method updatePaymentMethod

Some Joomla / PHP / Javascript skill needed here for this customization

Regards,

Tuan

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #169503 by Jibon
Replied by Jibon on topic Display extra options in payment method
Hi,

Thanks for reply. I know if I edit code then will be working but every update those will be lost. Wanted to use in a different way so that don't need to modify core code. Having some hook will be better.

Thanks

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #169506 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Display extra options in payment method
You can edit the code on that file and move the modified file to template override templates/template_name/html/com_pmform/Form folder so that the change won't be lost when you update to future releases of the extension

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc