View Product Page

Affiliate dashboard shortcode

The [yith_wcaf_affiliate_dashboard] shortcode allows you to display the Affiliate dashboard on a custom page of your choice.

The dashboard is divided into different sections and for each of them there’s a specific shortcode available, so you can either display the entire dashboard with all tabs or the content of specific tabs as you wish.

Print specific sections of the affiliate dashboard

With a shortcode for each section, the admin will be able to print that specific affiliate dashboard section on any page of the site.

  • Commissions: [yith_wcaf_show_commissions]
  • Visits: [yith_wcaf_show_clicks]
  • Link generator: [yith_wcaf_link_generator]
  • Payments: [yith_wcaf_show_payments]
  • Settings: [yith_wcaf_show_settings]

Each of these shortcodes can have custom settings for the pagination and the menu. You can use the following attributes to configure them:

  • pagination: (yes/no) enable/disable the pagination option for each section. It will show up only if the items are more than the value set in the following attribute per page.
  • per_page: a numeric value that shows the elements per page. Default value is 10.
  • current_page: page number shown in any section.
    Suppose that we have pagination for a list in the “Commissions” section, by specifying 2 as the parameter value, only page 2 will be shown in the section.
  • show_dashboard_links: (yes/no): this allows showing the menu to navigate among the various sections also.
Menu

Registration form shortcode

The [yith_wcaf_registration_form] shortcode shows the affiliate form, so your users can submit their affiliate application from any page of your website.

Registration form - shortcode

You can enable or disable the default fields from YITH > Affiliates > General Options > Affiliate Registration as explained here.

If the affiliate has already applied for the affiliate programme, a message will be displayed to inform about the submitted application.

Affiliate registered

The available attributes are:

  • show_login_form: (yes/no) show or hide the login form together with the registration form
  • login_title: you can set here the title of the login form, if displayed
  • register_title: you can set here the title of the register form

Example:

[yith_wcaf_registration_form show_login_form="yes" login_title="Log in here" register_title="Apply for our Affiliate Programme"]

Visible content shortcode

You can use this shortcode to show custom content that has to be visible to the affiliates only. It works like an opening and closing tag set, so the text goes between the tags.

Example:

[yith_wcaf_show_if_affiliate] This content will only be visible to affiliates [/yith_wcaf_show_if_affiliate]

Or if you use blocks, you can add the opening shortcode in one block, then add a block with your content, and finally add another shortcode block with the closing shortcode.

If you are not an affiliate, you will not be able to see the content.

Attributes

The shortcode can also be used for more complex cases, thanks to the included attribute that allows you to show the content to specific affiliates only.

The attribute is show_to and the following are the accepted values:

  • valid_affiliates: shown only to valid affiliates, that is enabled affiliates and hidden to banned ones.
  • enabled_affiliates: shown only to enabled affiliates.
  • all_affiliatesshown to all affiliates.
  • {user role}if you enter a valid user role name, such as shop_manger, the content will be shown just to users with both the shop manager role.
  • logged_in_users: shown only to logged users.
  • anyone: all users.

You can also combine more than one conditions separated by commas and the content will be displayed if at least one of those is true.

Additionally, it is possible to deny one condition by applying a ! before the condition. This could be useful, for example, if you want to show the content to everyone but affiliates.

Example with attribute:

[yith_wcaf_show_if_affiliate show_to="enabled_affiliates"]
CONTENT FOR AFFILIATES ONLY
[/yith_wcaf_show_if_affiliate]

[yith_wcaf_show_if_affiliate show_to="all_affiliates"]
CONTENT FOR NON-AFFILIATES ONLY
[/yith_wcaf_show_if_affiliate]

Blocks

The plugin is ready to use with the block editor. When you add a new post or page, you will be able to find our YITH shortcodes and widgets. With a simple click, they will be added to your page.

The plugin includes the following blocks:

1. Affiliate Dashboard block

Gutenberg - affiliate dashboard


The block allows you to display the affiliate dashboard and from the attributes you can:

  • Choose the section to show: you can choose between dynamic, which will let your users select the section from the menu and navigate among the multiple sections, or one of the specific sections among commissions, visits, coupons, payments, link generator and settings.
  • Show navigation menu: this allows you to show the navigation menu on top so to let your user move among the many available sections.

2. Registration form block

Gutenberg - registration form


This block will print the affiliate registration form. From the block attributes on the right you will be able to set the following:

  • Show login form: you can include also the login form or show just the affiliate registration form
  • Title to show above login form
  • Title to show above the register form

This block allows you to print the Link generator section.

Gutenberg - link generator

4. Set referrer box (checkout block)

This block allows you to print the box through which users can enter the affiliate who referrered them.

Set referrer box
Referrer block
Referrer block
Block options
Block options

This is an example of how it shows on the frontend.

Referrer box on Checkout page