Home›Support›English Support›[Resolved] AffiliateWP “Affiliate Portal” shows only in default language (EN), not in secondary language (D...
[Resolved] AffiliateWP “Affiliate Portal” shows only in default language (EN), not in secondary language (D...
This thread is resolved. Here is a description of the problem and solution.
Problem: You are using the AffiliateWP 'Affiliate Portal' with WPML on a bilingual site and encountering issues where only the language in which settings are saved shows the Portal layout correctly. Switching to the German backend shows 'None' in dropdowns, and saving settings in one language clears them in another. Solution: 1. Ensure you back up your site before making changes. 2. Resave all your 'affwp_settings' in English first. 3. Add this code to your functions.php file to ensure the affiliate page ID is correctly translated:
4. To translate menu link titles and URLs, modify the .../wp-content/plugins/affiliatewp-affiliate-portal/includes/core/class-menu-links.php file as follows:
If this solution does not resolve your issue or seems outdated, please check related known issues, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If needed, do not hesitate to open a new support ticket.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Background of the issue:
I am trying to use the AffiliateWP 'Affiliate Portal' with WPML on a bilingual site where English is the default language and German is the secondary language. In the backend under AffiliateWP > Settings > Affiliates, there are dropdowns to assign the Affiliate Account, Login, and Registration pages. When I’m in the English backend (&lang=en), I can assign the correct pages, and the portal shows fine on /affiliate-area/. However, when switching to the German backend (&lang=de), those dropdowns show 'None' as selected. If I assign the correct translated pages for DE (/de/partner-bereich/ etc.) and save, the English settings are cleared. This issue can be seen on the following pages: EN: hidden link DE: hidden link.
Symptoms:
Only the language where the settings are saved (EN or DE) displays the Portal layout. The other language reverts to the default Affiliate Area layout and the page dropdowns are cleared.
Questions:
How can I ensure that the Affiliate Portal layout is displayed in both languages using the translated Affiliate Area pages in WPML?
Why do the page dropdowns show 'None' when switching to the German backend?
I did review the workaround you suggested, but it appears to apply only to the **classic Affiliate Area**, which uses the `[affiliate_area]` shortcode and standard WordPress page templates. That snippet filters `affwp_affiliate_area_page_id`, which the **Affiliate Portal Addon does not use**.
The Affiliate Portal is a **JavaScript-based, full-screen experience** that loads via its own scripts (`core.js`, `sdk.js`, etc.) and uses the REST API under `/wp-json/affwp/v2/portal/...`.
The issue is that under *AffiliateWP > Settings > Affiliates*, I can only assign a **single page globally**. If I assign the English page, the portal works at `/affiliate-area/`. If I then assign the German translated page (`/de/partner-bereich/`), the previous assignment is overwritten, and the portal only works in German.
So the core problem is: **AffiliateWP does not store page assignments in a language-aware way**, and the portal does not respect WPML translations of that assigned page.
Please escalate this to a developer familiar with WPML language mapping and how filters like `affwp_affiliate_area_page_id` relate (or don’t relate) to the Portal Addon. This needs a deeper compatibility layer – one that can dynamically assign the correct portal page per language.
AffiliateWP is partially compatible with WPML and we are currently working with their team on finalizing the integration. Please see the documentation for more details.
If none of the above helps you to solve the problem, then we need to replicate this issue on a fresh WordPress installation. Then I'll be able to escalate it to our compatibility team. To achieve this, I created a test website with a clean WordPress installation. You can access it through this link:
hidden link
With this link, you'll be directly logged in.
Could you please install the AffiliateWP plugin and see if the issue is replicable on a clean WordPress installation?
I already configured WPML to have English as the default language and German as the second language.
Please also make sure that you are installing the latest version of the plugin.
When everything is finished and you can replicate the problem, please let us know.
Important! Do not import your site to the test site. We must replicate the problem on a fresh, clean WordPress installation.
Thanks a lot for replicating the problem on the sandbox site. Additionally, I greatly appreciate the video you shared, as it is beneficial for understanding the situation.
I attempted to find a workaround for this issue by translating system fields using the IDs of the selected page; however, it was unsuccessful. Therefore, I escalated this issue to our compatibility team. I'll keep you updated on any news regarding this issue.
I want to set expectations regarding this issue. We'll do our best to help you with this issue. If our compatibility team finds a workaround, we will share it with you. However, the permanent solution to this issue may not be solely within our control, and we will need the cooperation of the AffiliateWP authors to address this problem.
Regarding your request to translate menu link titles and URLs via WPML. Our compatibility team adds the following.
- The URLs will be automatically translated by WPML since you can only pick internal pages.
- For the label, follow this workaround
1. Take a backup of your site in case something goes wrong.
2. Open the .../wp-content/plugins/affiliatewp-affiliate-portal/includes/core/class-menu-links.php file with a code editor.
3. Look for line 102.
Replace:
// filter only menu links with a page.
$menu_links = array_filter(
$menu_links,
function( $menu_link) {
return ! empty( $menu_link['id'] );
}
);
With:
// filter only menu links with a page.
$menu_links = array_filter(
$menu_links,
function( $menu_link) {
return ! empty( $menu_link['id'] );
}
);
// WPML Workaround for compsupp-8049 - Register menu links labels with WPML
foreach ( $menu_links as $index => &$link ) {
if ( ! empty( $link['label'] ) ) {
do_action( 'wpml_register_single_string', 'affiliatewp-portal-menu', 'portal_menu_link_label_' . $index, $link['label'] );
$link['label'] = apply_filters( 'wpml_translate_single_string', $link['label'], 'affiliatewp-portal-menu', 'portal_menu_link_label_' . $index );
}
}
4. Go back to "AffiliateWP > Settings > Affiliate Portal" and resave.
5. Then go to "WPML > String Translation" to translate those labels.
**** Important! Please make a full site backup (files and DB) before you proceed with those steps****