- Posts: 2
- Thank you received: 0
MembershipPro - Payment plugin to add one more field to Subscription Plan
- VietHoang
- Topic Author
- Offline
- New Member
Less
More
3 years 8 months ago #135940
by VietHoang
MembershipPro - Payment plugin to add one more field to Subscription Plan was created by VietHoang
Hi admin,
I'm a newbie for Joomla + MembershipPro. I want to develop a payment plugin for Membership Pro using Stripe Connect payment gateway (which you are still does not support now).
I created a Membership Pro Payment Plugin follow the document at: membershipprodoc.joomservices.com/develo...n/dev-payment-plugin
However, I want to add 1 more field in the Subscription Plan setting page. So, I created another Membership Pro normal plugin follow the document at: membershipprodoc.joomservices.com/develo...mentation/dev-plugin
But, I don't know how to do them in just 1 plugin.
Could you please give some help in this case? some suggestions or documents, anything can help.
Many thanks,
I'm a newbie for Joomla + MembershipPro. I want to develop a payment plugin for Membership Pro using Stripe Connect payment gateway (which you are still does not support now).
I created a Membership Pro Payment Plugin follow the document at: membershipprodoc.joomservices.com/develo...n/dev-payment-plugin
However, I want to add 1 more field in the Subscription Plan setting page. So, I created another Membership Pro normal plugin follow the document at: membershipprodoc.joomservices.com/develo...mentation/dev-plugin
But, I don't know how to do them in just 1 plugin.
Could you please give some help in this case? some suggestions or documents, anything can help.
Many thanks,
Please Log in or Create an account to join the conversation.
- Richard
- Offline
- Junior Member
- I am a freelance web developer
3 years 8 months ago #135942
by Richard
Replied by Richard on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi Tuan,
I'd be interested in this too. I will be glad if I can be able to create a custom field in the plan edit page.
Something like the Paypal Email field that I can easily retrieve in the payment plugin using the sample code below.
$rowPlan = OSMembershipHelperDatabase::getPlan($row->plan_id);
$rowPlan->my_custom_field;
Please, I need this info too in order to add recurring payment ability to one of my existing payment plugin.
Regards,
Richard
--
I'd be interested in this too. I will be glad if I can be able to create a custom field in the plan edit page.
Something like the Paypal Email field that I can easily retrieve in the payment plugin using the sample code below.
$rowPlan = OSMembershipHelperDatabase::getPlan($row->plan_id);
$rowPlan->my_custom_field;
Please, I need this info too in order to add recurring payment ability to one of my existing payment plugin.
Regards,
Richard
--
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
3 years 8 months ago #135955
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi both
Unfortunately, there is no way to handle it using a single plugin. Maybe the simplest way would be adding file default_custom_settings.php to folder administrator/components/com_osmembership/view/plan/tmpl and add the fields you want there
Otherwise, you will need to add a second plugin to add the fields you want to plan setup
Tuan
Unfortunately, there is no way to handle it using a single plugin. Maybe the simplest way would be adding file default_custom_settings.php to folder administrator/components/com_osmembership/view/plan/tmpl and add the fields you want there
Otherwise, you will need to add a second plugin to add the fields you want to plan setup
Tuan
Please Log in or Create an account to join the conversation.
- Richard
- Offline
- Junior Member
- I am a freelance web developer
3 years 8 months ago #135971
by Richard
Replied by Richard on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
@Tuan,
As usual, thanks for your response.
However, I would like to ask, would the system automatically pick up the extra field(s) provided in the default_custom_settings.php file?
Secondly, would I still be able to fetch the field content using the method described in my previous comment in my payment plugin?
Regards,
Rich
As usual, thanks for your response.
However, I would like to ask, would the system automatically pick up the extra field(s) provided in the default_custom_settings.php file?
Secondly, would I still be able to fetch the field content using the method described in my previous comment in my payment plugin?
Regards,
Rich
Please Log in or Create an account to join the conversation.
- Richard
- Offline
- Junior Member
- I am a freelance web developer
3 years 8 months ago #136050
by Richard
Replied by Richard on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi Tuan,
It seems I have hijacked this topic. I'm sorry about that, but in anyway, we're all learning.
Back to the topic, I have followed your instruction to create a default_custom_settings.php file in administrator/components/com_osmembership/view/plan/tmpl, but the problem I'm having is that the custom fields do appear on the plan edit page but they don't save when I save the plan.
The changes I make to the custom settings before saving will always get lost.
When I do var_dump($this->item) in the frontend plan template, I don't see my custom settings anywhere in the output.
Attached is the code I have in the default_custom_settings.php file.
I don't know what I'm doing wrong, but I can't seem to get the custom settings working.
Your help will be highly appreciated.
Regards,
Rich
---
It seems I have hijacked this topic. I'm sorry about that, but in anyway, we're all learning.
Back to the topic, I have followed your instruction to create a default_custom_settings.php file in administrator/components/com_osmembership/view/plan/tmpl, but the problem I'm having is that the custom fields do appear on the plan edit page but they don't save when I save the plan.
The changes I make to the custom settings before saving will always get lost.
When I do var_dump($this->item) in the frontend plan template, I don't see my custom settings anywhere in the output.
Attached is the code I have in the default_custom_settings.php file.
I don't know what I'm doing wrong, but I can't seem to get the custom settings working.
Your help will be highly appreciated.
Regards,
Rich
---
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
3 years 8 months ago #136077
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi Richard
You need to add the fields you want to store data for these fields into #__osmemembership_plans table (name of the fields must be the same with name of the input) and the entered data should be stored automatically
Regards,
Tuan
You need to add the fields you want to store data for these fields into #__osmemembership_plans table (name of the fields must be the same with name of the input) and the entered data should be stored automatically
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
3 years 8 months ago #136079
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
BTW, please remove the link/advertisement you added to your signature. We do not allow advertisement / back links on our website
Hope you understand
Tuan
Hope you understand
Tuan
Please Log in or Create an account to join the conversation.
- VietHoang
- Topic Author
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
3 years 8 months ago #136165
by VietHoang
Replied by VietHoang on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi Tuan,
How can I add a field to the database table with a Membership Pro Payment plugin?
Thanks,
Viet
How can I add a field to the database table with a Membership Pro Payment plugin?
Thanks,
Viet
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
3 years 8 months ago #136167
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi Viet
Exactly what fields you want to add? If it's not complicated, I would suggest you to store data of these fields params field in #__osmembership_plans table. That field store some extra data (could be added by plugins) in json format. You can have a look at plugins/osmembership/joomlagroups/joomlagroups.php, method onAfterSaveSubscriptionPlan to see how we use that fields to get and store data for Joomla groups plugin
Tuan
Exactly what fields you want to add? If it's not complicated, I would suggest you to store data of these fields params field in #__osmembership_plans table. That field store some extra data (could be added by plugins) in json format. You can have a look at plugins/osmembership/joomlagroups/joomlagroups.php, method onAfterSaveSubscriptionPlan to see how we use that fields to get and store data for Joomla groups plugin
Tuan
Please Log in or Create an account to join the conversation.
- Richard
- Offline
- Junior Member
- I am a freelance web developer
3 years 8 months ago - 3 years 8 months ago #136286
by Richard
Replied by Richard on topic MembershipPro - Payment plugin to add one more field to Subscription Plan
Hi Tuan,
Thanks for your response.
I just want to save and retrieve the extra fields I specified in the default_custom_settings.php file in administrator/components/com_osmembership/view/plan/tmpl.
Please, can you guide me, step by step, on how to achieve the above. Do I need to write a new plugin for that.
Edited
Sorry, I have been able to get it working after I created the needed custom fields in the #__osmembership_plans database table
However, will an update affect this, I mean the extra database columns?
Regards,
Richard
Thanks for your response.
I just want to save and retrieve the extra fields I specified in the default_custom_settings.php file in administrator/components/com_osmembership/view/plan/tmpl.
Please, can you guide me, step by step, on how to achieve the above. Do I need to write a new plugin for that.
Edited
Sorry, I have been able to get it working after I created the needed custom fields in the #__osmembership_plans database table
However, will an update affect this, I mean the extra database columns?
Regards,
Richard
Last edit: 3 years 8 months ago by Richard.
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.