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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | 10:00 – 14:00 | - | - |
16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | 16:00 – 20:00 | - | - |
Supporter timezone: Asia/Jerusalem (GMT+03:00)
Tagged: Compatibility
This topic contains 6 replies, has 1 voice.
Last updated by Itamar 2 days, 17 hours ago.
Assisted by: Itamar.
Author | Posts |
---|---|
June 17, 2025 at 1:38 am #17140470 | |
kevinR-12 |
Background of the issue: Symptoms: Questions: |
June 19, 2025 at 3:42 pm #17151541 | |
Laura WPML Supporter since 05/2018
Languages: English (English ) Italian (Italiano ) Timezone: Europe/Rome (GMT+02:00) |
Hi, thanks for contacting us. Can you please check if this errata helps? |
June 20, 2025 at 10:27 am #17153798 | |
kevinR-12 |
Hi, Thanks for your reply and for sharing the errata. 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. Thanks again, |
June 23, 2025 at 7:41 pm #17162375 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Kevin. I'll continue to help you with this issue. Please note what we state on the plugins page here:
Further information can be found on their website here: hidden link 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. Regards, |
June 24, 2025 at 12:32 am #17162671 | |
kevinR-12 |
Dear Itamar, thanks a lot for the willingness to help provide better compatibility with AffiliateWP and for providing the sandbox. I already configured everything and recorded a screencast to show you how you can reproduce the issue: hidden link Please let me know if you have any further questions. Warm regards, Kevin |
June 24, 2025 at 11:01 am #17164388 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Kevin. 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. I appreciate your patience. |
July 2, 2025 at 10:09 am #17192135 | |
Itamar WPML Supporter since 02/2016
Languages: English (English ) Timezone: Asia/Jerusalem (GMT+03:00) |
Hi, Our compatibility team has shared workarounds for those cases. 1. Take a backup of your site in case something goes wrong. 2. Resave all your affwp_settings settings in English first. 3. Add the following code to your functions.php file: add_filter( 'affwp_affiliate_area_page_id', function( $affiliate_page_id ) { if ( defined( 'WPML_PLUGIN_FILE' ) ) { $affiliate_page_id = apply_filters( 'wpml_object_id', $affiliate_page_id, 'page', true ); } return $affiliate_page_id; }, 10, 1 ); 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. // 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. Please try this and let us know how it goes. Regards, |