1. Documentation /
  2. Extensions /
  3. Affiliate For WooCommerce /
  4. How to override templates

How to override templates

Affiliate for WooCommerce plugin helps you to add, manage affiliates, and track performance from a single place – commissions, sales, payouts, leaderboard, etc. Earn money without hard work. Increase your brand outreach, and get potential customers.

This doc explains how you can override the email templates that are sent to affiliates and affiliate manager/store admin.

All emails sent from the Affiliate for WooCommerce plugin are sent via existing templates (overridable) that are located in the ‘templates’ directory of Affiliate for WooCommerce – /affiliate-for-woocommerce/templates/.

If you want to change or modify the content of an email or if you want to change the email layout, you can do it by using the ‘another template file’ method.

Override via another template file (Upgrade-safe) ↑ Back to top

Use your own email template in place of the default one provided by Affiliate for WooCommerce. Copy the template into a directory named ‘woocommerce’ within your theme keeping the same file structure but removing the ‘templates’ subdirectory.

Consider you want to override the email sent to affiliates when they join your affiliate program. Follow these steps to override that template:

  1. Create a template file and keep the file name as: afwc-welcome-affiliate-email.php. Other file names will not work.
  2. Open your themes folder and check if you have a folder named woocommerce. If not, create a folder named woocommerce
  3. Open woocommerce folder and create a new folder inside it. Keep that folder’s name as: affiliate-for-woocommerce
  4. Place the file afwc-welcome-affiliate-email.php inside affiliate-for-woocommerce
    For example: To override the email template of the affiliate welcome email,
    copy: wp-content/plugins/affiliate-for-woocommerce/templates/afwc-welcome-affiliate-email.php
    to wp-content/themes/yourtheme/woocommerce/affiliate-for-woocommerce/afwc-welcome-affiliate-email.php

The copied file will now override the Affiliate for WooCommerce default email template file for the welcome email.

Affiliate for WooCommerce will use your template file (if found) for the email sent from the Affiliate for WooCommerce plugin.

You can follow this same method for these email templates of the Affiliate for WooCommerce plugin:

  1. afwc-commission-paid.php – Email is sent to the affiliate when commission is paid on their referral orders.
  2. afwc-new-conversion.php – Email is sent to the affiliate when a new order is placed using their referral link/coupon.
  3. afwc-new-registration-received.php – Email is sent to the affiliate manager/store admin when someone joins your affiliate program.

Notes

1. We recommend using the child theme if you are overriding the templates as explained above. Read more here: Set up and use a child theme.
2. The above method is considered customization. We are happy to provide guidance, but we are unable to provide support or help to suit your store. Only use it if you are comfortable with PHP and custom coding and troubleshooting on your own.

Feature request ↑ Back to top

Have a feature request or enhancement suggestion for Affiliate For WooCommerce? Submit it from here: Submit a feature request.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment