Template files contain the markup for the frontend views and HTML emails in Refer A Friend. All of these templates can be customized by overriding one or more files in your theme. Customizing a template is sometimes required if you want to change the text shown on the frontend.
Note: This is a Developer level doc provided as guidance. We are unable to dispense advice or review code under our Support Policy.
Template files can be found within the
List of template files:
- account-tab.php – Outputs all account tab markup
- account-tab-referral-table-row.php – Outputs markup for a single row in the account referral table
- account-tab-referral-tables.php – Outputs markup for both referral tables in the account area
- email-share-button.php – Outputs a single share button for the email share widget
- email-share-buttons.php – Outputs all enabled share buttons in the email share widget
- email-styles.php – Contains the CSS used for the email share widget
- share-page.php – Outputs markup for the share page
- share-page-form.php – Outputs markup for the share form on the share page
- share-page-login.php – Outputs login request markup, shown when a user is logged out
- share-widget.php – Outputs the website version of the share widget
- share-widget-email.php – Outputs the email version of the share widget
How to edit a template file
It’s important to not edit the files directly in the
/automatewoo-referrals/templates/ directory because all plugin files are replaced when you update the plugin. Edit files in an upgrade-safe way using overrides.
Copy the template into a directory in your theme named
/automatewoo/referrals/ keeping the same file structure but removing the
For example: To override the share page template, copy:
Then you can make changes to the copied file and it will override the default template file in the plugin.
- Please note: Template files will sometimes be changed in a plugin update and you might need to update your overriden templates. Please check the changelog each time you update to ensure that there were no changes that affect you.