Adding Affiliate ID to Themes
Step 1) Add your affiliate ID to the theme
Then, click on the Affiliate tab.
You’ll see a box with the affiliate information (highlighted in the image above).
This code includes your affiliate ID and key and looks like this:
define('ICL_AFFILIATE_ID', YOUR_AFFILIATE_ID); define('ICL_AFFILIATE_KEY', 'YOUR_AFFILIATE_KEY');
Insert this in functions.php in the theme.
Your code never changes and you can insert it to as many themes as you like.
Step 2) Validate your affiliate ID
WPML allows you to validate your affiliate data. This will help you ship out themes, knowing for sure that when your clients order translation work you’ll be credited.
To enable validation, you need to add the following PHP code:
The best place to add this code is to the wp-config.php file, just before where it says to stop editing. After you’re done with this check, remember to remove that line.
When DEBUG_WPML_AFFILIATE is set, an Affiliates item will appear in WordPress, under the WPML menu.
You cannot edit the values in this form. WPML takes them from the affiliate defines that you entered before. The idea is to simulate what happens when your clients create account in ICanLocalize.
This form will check that both the affiliate ID and key are found in the theme and will validate them with ICanLocalize. If it says the affiliate information is correct (as shown in the image), you’re done.
Otherwise, double check the PHP you’ve inserted and make sure it’s in the right place.
Note: DEBUG_WPML_AFFILIATE is meant for you to check that you’ve inserted the affiliate information correctly. When you’re done building the theme, remove this constant. The Affiliates menu will disappear from WPML.