By Christopher Ambler on Tuesday, 17 November 2020
Posted in General Issues
Likes 0
Views 560
Votes 0
I have a menu item for registration created in a menu.

When PayPlans sends a user to register, however, this menu item is not the one triggered.

The menu item is created by specifying com_user as the component and registration as the view, and given "registration" as an alias.

Looking at your code, you seem to build this URL directly and are not passing it through Joomla's router. This will preclude ever using the correct menu item (and Itemid) for registration.

Modifying your code to look like this fixes the problem (line 21 in /administrator/components/com_payplans/includes/registration/adapters/joomla.php):


$this->url = JRoute::_('index.php?option=com_users&view=registration&fromPayplans=1');


This causes the URL to be passed through the router and then generates the correctly-routed URL:


https://www.example.com/registration?fromPayplans=1


Can you fix this?

SECOND QUESTION: While I'm here, if I wrote my own registration adapter, where would I install it so as to not have to re-apply it every time I upgrade?
Hi there,

I'm sorry for the confusion.

Regarding,
> Looking at your code, you seem to build this URL directly and are not passing it through Joomla's router. This will preclude ever using the correct menu item (and Itemid) for registration.
> you're saying you're not calling JRoute::_() on purpose, and you won't change it? Are you referring to the first issue?


I've mentioned in the previous reply that I've logged this to our developer to fix it. It will be available in the next release.

About,
> While I'm here, if I wrote my own registration adapter, where would I install it so as to not have to re-apply it every time I upgrade?

I have consulted with our developer, currently, this is not possible as the registration type is a core feature and it will get erased when updating PayPlans.

> If so, that means third parties can't write registration integrations at all?

Based on my previous reply, you can submit a feature request on this (supports for 3rd party registration integration) and we'll see how can we implement this in PayPlans. It is a good feature to be added to PayPlans.

I am sorry again for the confusion.
Hope this helps.
Thanks.
·
Tuesday, 17 November 2020 13:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

Thanks for reporting this issue. I've logged this issue to our developer to be fixed.

Regarding,
> While I'm here, if I wrote my own registration adapter, where would I install it so as to not have to re-apply it every time I upgrade?

You can just duplicate this file: /administrator/components/com_payplans/includes/registration/adapters/joomla.php and rename the file with your custom adapter and change the class name to the same as your file name. Example:

/administrator/components/com_payplans/includes/registration/adapters/customjoomla.php

class PPRegistrationCustomjoomla extends PPRegistrationAbstract
{
}


PayPlans will automatically pick up this file in registration integration settings as shown in the attached screenshot.

Hope this helps.
·
Tuesday, 17 November 2020 12:12
·
0 Likes
·
0 Votes
·
0 Comments
·
And if I do that, it won't get erased on an upgrade?
·
Tuesday, 17 November 2020 12:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

I've consulted with our developer, this registration type is a core feature. Therefore, unfortunately, will be erased when updating PayPlans. I am sorry for the inconvenience.

There is no other way to achieve this. You can submit a feature request at https://stackideas.com/voices/payplans.

Or if you require us to perform the customization for you, you can always request a quote from us at https://crm.stackideas.com and select "Customizations". Our salesperson would gladly send you a quote for the customization that you have requested.

Hope this helps.
Thanks.
·
Tuesday, 17 November 2020 12:48
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm not sure I understand - you're saying you're not calling JRoute::_() on purpose, and you won't change it? Are you referring to the first issue?

Or are you saying that I can't write my own registration integration, referring to the second issue? Can't I just clone the Joomla one and call it something else? Or are you saying that whole directory will be erased on an upgrade? If so, that means third parties can't write registration integrations at all?

Which issue are we talking about?
·
Tuesday, 17 November 2020 12:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Perfect - thanks for clearing that up. Good that the routing will be fixed. I'll submit a feature request.

Thanks again!
·
Tuesday, 17 November 2020 13:16
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusion in the future. Please start a new thread if you have any other issues in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Tuesday, 17 November 2020 13:17
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post