- Posts: 14
- Thank you received: 0
Automatically add subscription to Membership by registration for an event
- Pascal
- Topic Author
- Offline
- New Member
Less
More
4 years 3 months ago #130540
by Pascal
Automatically add subscription to Membership by registration for an event was created by Pascal
Hi there
I have a special usecase, for our trips you have to be part of the community. By registration for the event the user should automatically added to a subscription, which end automatically by the end of the year.
But this subscription should show up separately on the invoice.
And if the user register for a second event in the same year, the subscription is not needed for the second event.
Do you easily see a solution therefore?
Best regards
Pascal
I have a special usecase, for our trips you have to be part of the community. By registration for the event the user should automatically added to a subscription, which end automatically by the end of the year.
But this subscription should show up separately on the invoice.
And if the user register for a second event in the same year, the subscription is not needed for the second event.
Do you easily see a solution therefore?
Best regards
Pascal
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
4 years 3 months ago #130563
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Automatically add subscription to Membership by registration for an event
Hi Pascal
This is a special requirement, and not supported in the extension. If you need it, you will have to hire a developer to develop a plugin for you to create a subscription record for the user when they register for an event
Tuan
This is a special requirement, and not supported in the extension. If you need it, you will have to hire a developer to develop a plugin for you to create a subscription record for the user when they register for an event
Tuan
Please Log in or Create an account to join the conversation.
- Pascal
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 3 months ago #130579
by Pascal
Replied by Pascal on topic Automatically add subscription to Membership by registration for an event
Hi Tuan
Thank you for your Answer. So the question is, if you would do something like this? The most cleanist way would be a connection between the two components "Event Booking" and "Membership Pro"?
I do develop myself, but never really interested in website. So can you explain in two sentences, where I would need to override sources, or extend them?
Thank you
Pascal
Thank you for your Answer. So the question is, if you would do something like this? The most cleanist way would be a connection between the two components "Event Booking" and "Membership Pro"?
I do develop myself, but never really interested in website. So can you explain in two sentences, where I would need to override sources, or extend them?
Thank you
Pascal
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
4 years 3 months ago #130580
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Automatically add subscription to Membership by registration for an event
Hi Pascal
You would need to develop a plugin for Events Booking eventbookingdoc.joomservices.com/develop...mentation/dev-plugin
The event which you need to listen for is onAfterPaymentSuccess(which is triggered after payment for the registration is paid)
On that method, you will need to write code to create a new subscription or the user for the plan you want. You can borrow some code from plugins/user/osmembership/osmembership.php, method onUserAfterSave to see how to add new subscription record for a user
Tuan
You would need to develop a plugin for Events Booking eventbookingdoc.joomservices.com/develop...mentation/dev-plugin
The event which you need to listen for is onAfterPaymentSuccess(which is triggered after payment for the registration is paid)
On that method, you will need to write code to create a new subscription or the user for the plan you want. You can borrow some code from plugins/user/osmembership/osmembership.php, method onUserAfterSave to see how to add new subscription record for a user
Tuan
Please Log in or Create an account to join the conversation.
- Pascal
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 3 months ago #130786
by Pascal
Replied by Pascal on topic Automatically add subscription to Membership by registration for an event
Hi Tuan
Thank you for your short introduction. I have now a very first simple solution, which I will extend once, but for now it's alright.
One "small" thing I still have, you may could help me. The participant will be registered automatically to a subscription, this is working. But the email with the invoice is not send.
$model = new OSMembershipModelApi();
try {
$model->store($data);
These lines works, but do not create an email with the invoice. First is this a bug? Or on purpose?
If I go manually in to the component and "resend emails" it creates the email I wish for. But not automatically.
I saw the helper function OSMembershipHelperMail::sendEmails() but I don't know where I get the param ($row=OSMembershipTableSubscriber) from. Or is there an even smarter way to solve that issue?
Thank you
Pascal
Thank you for your short introduction. I have now a very first simple solution, which I will extend once, but for now it's alright.
One "small" thing I still have, you may could help me. The participant will be registered automatically to a subscription, this is working. But the email with the invoice is not send.
$model = new OSMembershipModelApi();
try {
$model->store($data);
These lines works, but do not create an email with the invoice. First is this a bug? Or on purpose?
If I go manually in to the component and "resend emails" it creates the email I wish for. But not automatically.
I saw the helper function OSMembershipHelperMail::sendEmails() but I don't know where I get the param ($row=OSMembershipTableSubscriber) from. Or is there an even smarter way to solve that issue?
Thank you
Pascal
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
4 years 3 months ago #130787
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Automatically add subscription to Membership by registration for an event
Hello
You need to call API to send email manually. Something like:
$row = $model->store($data);
$config = OSMembershipHelper::getConfig();
OSMembershipHelper::sendEmails($row, $config);
Tuan
You need to call API to send email manually. Something like:
$row = $model->store($data);
$config = OSMembershipHelper::getConfig();
OSMembershipHelper::sendEmails($row, $config);
Tuan
Please Log in or Create an account to join the conversation.
- Pascal
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 3 months ago #130810
by Pascal
Replied by Pascal on topic Automatically add subscription to Membership by registration for an event
Hi Tuan
Yes, this kind of works. The email for the membership subscriptions is now sent, but the event registering is not finishing anymore... Now a blank page appears. If I activate error handling, folllowing error appears:
Notice: Undefined index: none_taxable_fee in /joomla/components/com_osmembership/helper/helper.php on line 890
Notice: Undefined index: act in /joomla/components/com_osmembership/helper/helper.php on line 994
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /joomla/components/com_eventbooking/tcpdf/tcpdf.php on line 17782
Fatal error: Cannot declare class TCPDF, because the name is already in use in /joomla/components/com_eventbooking/tcpdf/tcpdf.php on line 132
The invoice pdf for the membership is generated and send correctly per email, but I don't get any email for the event registration anymore.
Do you see the issue?
Thank you
Pascal
Yes, this kind of works. The email for the membership subscriptions is now sent, but the event registering is not finishing anymore... Now a blank page appears. If I activate error handling, folllowing error appears:
Notice: Undefined index: none_taxable_fee in /joomla/components/com_osmembership/helper/helper.php on line 890
Notice: Undefined index: act in /joomla/components/com_osmembership/helper/helper.php on line 994
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /joomla/components/com_eventbooking/tcpdf/tcpdf.php on line 17782
Fatal error: Cannot declare class TCPDF, because the name is already in use in /joomla/components/com_eventbooking/tcpdf/tcpdf.php on line 132
The invoice pdf for the membership is generated and send correctly per email, but I don't get any email for the event registration anymore.
Do you see the issue?
Thank you
Pascal
Please Log in or Create an account to join the conversation.
- Pascal
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 2 months ago #130899
by Pascal
Replied by Pascal on topic Automatically add subscription to Membership by registration for an event
Any idea?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
4 years 2 months ago #130911
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Automatically add subscription to Membership by registration for an event
Hello
From what I see, it causes by the conflict between the two extensions when TCPDF is loaded on both. You can try the solution below:
- Open the file components/com_osmembership/helper/helper.php
- Find the method generateInvoicePDF
- Change the code from:
to:
Then try again. Maybe it would address the issue
Tuan
From what I see, it causes by the conflict between the two extensions when TCPDF is loaded on both. You can try the solution below:
- Open the file components/com_osmembership/helper/helper.php
- Find the method generateInvoicePDF
- Change the code from:
Code:
require_once JPATH_ROOT . '/components/com_osmembership/tcpdf/tcpdf.php';
require_once JPATH_ROOT . '/components/com_osmembership/tcpdf/config/lang/eng.php';
to:
Code:
if (!class_exists('TCPDF'))
{
require_once JPATH_ROOT . '/components/com_osmembership/tcpdf/tcpdf.php';
require_once JPATH_ROOT . '/components/com_osmembership/tcpdf/config/lang/eng.php';
}
Then try again. Maybe it would address the issue
Tuan
The following user(s) said Thank You: Pascal
Please Log in or Create an account to join the conversation.
- Pascal
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 2 months ago #130941
by Pascal
Replied by Pascal on topic Automatically add subscription to Membership by registration for an event
Thank you very much. This worked. I just had to add it in the event booking helper and not the membership pro helper.
Thank you very much
Pascal
Thank you very much
Pascal
Please Log in or Create an account to join the conversation.
Moderators: Tuan Pham Ngoc
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.