Override Subscription Module

2 months 1 week ago - 2 months 4 days ago #1 by Stéphan
Override Subscription Module was created by Stéphan
Hi CHristopher,
I'm trying to make an override for the subscription module of NS Pro - I need it it to fix some Yootheme design integration.
I have found this code in the module mod_nspro.php file :
$override_file = JPATH_SITE.DS.'templates'.DS.$app->getTemplate().DS.'html'.DS.'com_nspro'.DS.'nspro'.DS.$filename;
So I tried to make my override there :
mytemplate -> html -> com_nspro -> nspro -> default.php
But it is not working. Do I miss something ? Thanks for your advice.
Joomla 4.4.4 - PHP 8.2.0 - NS Pro 3.2.2815

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

2 months 6 days ago #2 by Christopher Mavros
Replied by Christopher Mavros on topic Override Subscription Module
Hi Stéphan.
You are correct.
Can you please try to change mod_nspro.php, line 50 to
$this->loadTemplate();
and let me know if it works for you?

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

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

2 months 6 days ago - 2 months 6 days ago #3 by Stéphan
Replied by Stéphan on topic Override Subscription Module
Hi Christopher,
Thanks for fast reply :-)
In my mod_nspro.php at line 50, i have this code :
include(JPATH_SITE.'/components/com_nspro/views/nspro/tmpl/default.php');
When I change this with your suggestion, i get an error 500 (i was sure before trying, but i tried it anyway ;) )
Are you sure this the line to change ?

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

2 months 5 days ago #4 by Christopher Mavros
Replied by Christopher Mavros on topic Override Subscription Module
This line, line 50
include(JPATH_SITE.'/components/com_nspro/views/nspro/tmpl/default.php');
needs to be changed to
print $this->loadTemplate();
I just tried it on my end and it works. What is the exact error you get?

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

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

2 months 4 days ago - 2 months 4 days ago #5 by Stéphan
Replied by Stéphan on topic Override Subscription Module
Hi Christopher,
Yep ! Work like a charm on my end too !
The "print" thing was not on your first answer, that's why I could not make it works. I should have added it by myself, now you know my level in php :-)
Thanks for your feedback.

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

2 months 4 days ago #6 by Christopher Mavros
Replied by Christopher Mavros on topic Override Subscription Module
I also initially thought that the loadTemplate() function would print things out itself because it included the layouts using 'include', but at the end it returns an output buffer, so 'print' was indeed required.
I'm glad it works for you now. I have also fixed this on my end and it will be included in the next release.
You can update without concern.

Christopher Mavros
mavrosxristoforos@gmail.com
If you like our extensions, please rate us on the JED!

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

Moderators: Christopher Mavros