Customizations

Template override

Template overriding is the best way to allow customizing the layouts without modifying the files and contents of the component.

There are tons of benefits if you perform template overriding rather than modifying the core files. Some of it includes: Customization won't be lost if you upgrade PayPlans and More control over files.

We have divided template overriding of PayPlans in three parts - 1. Core Template Override 2. Plugin Template Override 3. App Template Override.

Core Template Override

To override the PayPlans component's display you should follow the following steps

1 Go to the file path : Your_Site_ROOT/templates/YOUR_CURRENT_JOOMLA_TEMPLATE/html.

2 Create a directory with the component name, e.g. com_payplans.

3 Go to that directory com_payplans and create another directory with the name of view, which you want to override, e.g dashboard.

4 Go to that directory dashboard and create the file or copy the file which you want to override and make changes.

5 Write or change the code of this file according to your need.

Lets take an example. We have a screen of Login/Registration after Plan Selection.

Default Login Page

The URL of this screen is 'www.MY_SITE.com/index.php?option=com_payplans&view=plan&task=login'.

1 In URL option is com_payplans, so I have to look for JOOMLA_ROOT -> components -> com_payplans

2 This URL will take you to the 'plan' section. It means I need to look for templates -> default -> 'plan', in addition to the above path.

Here, 'default' is the template name of PayPlans. (currently it is only default, in future it may have several templates.
Then you will need to use your current PayPlans template name instead of 'default')

3 In the above path, there is a file 'default_login.php' from where the login box comes.

4 Now go to file path : Your_Site_ROOT/templates/YOUR_CURRENT_JOOMLA_TEMPLATE/html.

5 Create a directory named com_payplans (it is the value of option)

6 Create a directory in com_payplans named plan (it is value of view)

7 Copy the default_login file from its original location (as described above) to plans directory.

8 Remove the code of login box from this file.

9 Check the login page again. It will look like below screen-shot:

Overridden Template Output

Plugin Template Override

Follow these steps to change the display of any plugin of Payplans, if plugin displays anything like Registration etc.

1 Go to path: JOOMLA_ROOT/templates/YOUR_CURRENT_JOOMLA_TEMPLATE/html

2 Create a directory with the component name i.e. 'com_payplans'

3 Create a directory named '_plg'.

4 Create a directory with name of plugin type in _plg folder(like payplans, payplansregistration etc).

5 Create a directory with the name of plugin.
For example: If the template you want to override, belongs to a plugin of type 'payplans', then the overridden path would be :

  JOOMLA_ROOT/templates/YOUR_CURRENT_JOOMLA_TEMPLATE/html/com_payplans/_plg/payplans/PLUGIN_NAME/ 

6 Copy the plugin template from its original location to above directory and do the required changes.

App Template Override

Follow these steps to change the display of any App of Payplans, if App displays anything like Userdetail, Payment App etc.

1 Go to path: JOOMLA_ROOT/templates/YOUR_CURRENT_JOOMLA_TEMPLATE/html

2 Create a directory with the component name i.e. 'com_payplans'

3 Create a directory named '_app'

4 Create a directory with the name of app in _app folder (like paypal, authorize, userdetail etc)

For example: If the template you want to override, belongs to an app 'paypal', then the overridden path would be :

  JOOMLA_ROOT/templates/YOUR_CURRENT_JOOMLA_TEMPLATE/html/com_payplans/_app/paypal/

5 Copy the file from its original location to above directory and do the required changes.

We hope the Document was helping for you. If you need any assistance please feel free to contact us at support@readybytes.in