Last updated
Refer a Friend’s front-end screens and emails are built from template files, like WooCommerce’s. To change their HTML or text beyond what the settings allow, copy a template to your theme and edit the copy. Plugin updates don’t overwrite it.
Before you start: use a child theme, so a theme update doesn’t remove your templates. Templates checked with version 4.4.12.
Copy a template
- In your child theme folder, create a folder named
wpgens-raf. - Find the template in the plugin folder,
wp-content/plugins/wpgens-refer-a-friend-premium/templates/. - Copy it to
wpgens-raf/in your theme, keeping the same subfolders. See the table below. - Edit your copy.
Where each template goes
The modern design, which is the default, uses the modern subfolder. Emails always use emails.
| What you want to change | Plugin file | Copy to your theme as |
|---|---|---|
| My Account tab | templates/modern/myaccount-tab.php |
wpgens-raf/modern/myaccount-tab.php |
| Product page tab | templates/modern/product-tab.php |
wpgens-raf/modern/product-tab.php |
[WOO_GENS_RAF_ADVANCE] and thank-you page |
templates/modern/advance-shortcode.php |
wpgens-raf/modern/advance-shortcode.php |
| What guests see | templates/modern/guest-*.php |
wpgens-raf/modern/guest-*.php |
| Parts: link, rewards box, share buttons, text, guest form | templates/modern/parts/*.php |
wpgens-raf/modern/parts/*.php |
| Coupon, reminder and share emails | templates/emails/*.php |
wpgens-raf/emails/*.php |
If you turned on Use old legacy look, copy from templates/ without modern, to wpgens-raf/ without modern.
Your copies don’t get the plugin’s fixes and new features. After a plugin update, compare your copies with the new templates, and copy only the files you really need to change.
Simpler alternatives
- To change texts, use Display Settings and the WooCommerce email settings first.
- To change colors or spacing, add CSS in Appearance → Customize → Additional CSS instead of copying templates. The referral section’s classes start with
gens-referral_andgens-raf. - To translate texts, see Translate Refer a Friend.
Check it worked
Add a small visible change to your copy, such as a word, and reload the page. If you don’t see it, check the folder name and whether you used the modern subfolder. Then clear your caching plugin’s cache.