Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client reported that the Donate button was only functioning on the English version of their website, not on the Croatian version.
Solution:
We identified that the issue was due to multiple instances of the same ID being used for the Donate button, which is generated by the Donations Plugin. Here are the steps we took to resolve the issue:
1. Accessed the Elementor Header template in the default language.
2. Replaced the shortcode

[dp_donation_modal]

with

[dp_donation_modal_off]

in the template.
3. Advised the client to remove or replace the shortcode in other places where it appeared but was hidden in the desktop view.
To avoid similar issues in the future, we recommended either using the button ID only once per page or updating the plugin code to use a class selector instead of an ID for JavaScript triggers.
The popup should now work in both languages. We asked the client to confirm if the issue was resolved.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, please do not hesitate to open a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, you can contact us directly through our support forum.

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.

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Noman 2 months, 1 week ago.

Assisted by: Noman.

Author Posts
September 2, 2024 at 10:16 am #16130958

matijaG-2

Hi,

Donate button is now working only on English version.

Please check why does it not work on Croatian version?

Thanks a lot

eng_pop_up_works_well_Large.jpeg
September 2, 2024 at 7:10 pm #16133366

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. I noticed that the Donate button and popup are generated by the "Donations Plugin," which creates the following button:

<button id="donateModalBtn" class="dp-donate-button">DONIRAJ</button>

and uses the JavaScript code below to trigger the click event:

 var btn = document.getElementById("donateModalBtn");

However, there were three instances of the button in the header template, causing the issue. The ID should be unique in a page, otherwise, a Class selector should be used instead.

So, I’ve followed the below steps in order to solve this issue:

1. I edited the Elementor Header template in the default language.
2. I replaced the shortcode::

[dp_donation_modal]

With:

[dp_donation_modal_off]

3. I made this change in the two other places where the button appeared hidden in the desktop view. You may remove the shortcode according to your needs in other two places.

To permanently fix this issue, you should either:
- Use the button ID only once per page, or
- Update the plugin code to use the class selector in jQuery/JS instead of the ID.

The popup is now working in both languages. Could you please check and confirm?

Thank you for your cooperation and patience

default language popup.png
secondary lang popup.png