Skip Navigation

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.

This topic contains 0 replies, has 0 voices.

Last updated by Shekhar Bhandari 2 weeks, 4 days ago.

Assisted by: Shekhar Bhandari.

Author Posts
January 6, 2025 at 9:32 am #16565432

恺 黄

Background of the issue:
I am trying to ensure that the shopping cart icon in the header of my website, after switching the language, correctly translates the 'view cart' and 'checkout' button URLs to the translated page. These buttons use the WooCommerce shortcode [woocommerce_cart] and [woocommerce_checkout] respectively. I am unable to find the corresponding string translations in the backend. The site I need help with is hidden link.

Symptoms:
The 'view cart' and 'checkout' button URLs do not convert to the translated page after switching languages.

Questions:
How can I ensure the 'view cart' and 'checkout' button URLs translate correctly after switching languages?
Where can I find the string translations for these buttons in the backend?

January 6, 2025 at 11:27 am #16566147

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

To further debug the issue with the currency icon on the popup, I would need to replicate you site on my localhost and perform further debugging.

Being so, can you provide me your site backup, you can backup wp-content folder and database and share the links with me using some file sharing platforms.

Enabled the private reply for you.

Thanks

January 7, 2025 at 5:47 am #16567990

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

As mentioned, to debug this further, I will need to do a proper debugging and it's not possible to do on the site itself.

Being so, can you provide me your site backup, you can backup wp-content folder and database and share the links with me using some file sharing platforms.

Enabled the private reply for you.

Thanks

January 9, 2025 at 3:37 am #16575911

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hi there,

Due to certain restrictions on the site, I currently don't have the necessary file access, and performing multiple iterations won’t be feasible in this environment.

As mentioned earlier, to proceed with a thorough debugging process, I’ll need to work on my localhost, as it's not possible to debug directly on the live site.

Therefore, could you please provide a backup of your site, including the **wp-content** folder and the database? You can share the backup links via any preferred file-sharing platform.

I’ve enabled the private reply option for you to share the files securely.

Thank you!

January 9, 2025 at 4:21 am #16575923

恺 黄

Do you need a backup file for the whole site, or is it enough to have just the two files wp-content and the database backup? Do I send you the zip file directly, I haven't done that with file sharing platforms.

January 9, 2025 at 4:29 am #16575925

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

two files wp-content and the database backup?

This will work.

Enabled the private reply for you.

Thanks

January 9, 2025 at 5:53 am #16575949

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I tried to download it but both the download links is not working, can you please check?

You can also add the files in the ftp directory and share me the ftp details if that's possible.

Look forward to your reply.

Thanks

January 9, 2025 at 6:03 am #16575972

恺 黄

I shared the link, in China can be downloaded normally, you side can not open the download, there are other ways, very troublesome, I also have not used Duplicator, this processing is too cumbersome!

baidu1.png
January 9, 2025 at 6:08 am #16575988

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Let me try to see if I can create backups manually using the staging site.

I will update you further here.

Thanks

January 9, 2025 at 6:15 am #16575991

恺 黄

Okay, you said not to operate in the production environment because I purposely set up a separate test site for ease of use. I don't have experience with file transfer and sharing across borders, and that would be a complicated and time-consuming solution.

January 9, 2025 at 6:40 am #16576022

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I managed to create a duplicator package and I can see the issue, it looks like the essential addons plugins uses a ajax function to load the popup which results in the difference.

To fix the issue, I would suggest to add the following to your theme functions.php file

add_filter( 'wcml_multi_currency_ajax_actions', 'add_action_to_multi_currency_ajax', 10, 1 );
 
function add_action_to_multi_currency_ajax( $ajax_actions ) {
 
    $ajax_actions[] = 'eael_product_quickview_popup'; // Add a AJAX action to the array
    return $ajax_actions;
 
}

https://wpml.org/wcml-hook/wcml_multi_currency_ajax_actions/

Make sure to clear the cache before testing it.

Let me know if this helps.

Thanks

January 9, 2025 at 6:52 am #16576077

恺 黄

ok, is it adding the following code to my test site functions.php file?
But I don't understand which theme file is for Siteground, I don't see the functions.php file

function.png
January 9, 2025 at 6:55 am #16576093

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

The used theme is astra so go inside wp-content/themes/astra and edit the functions.php file, at the end of the file add the code.

Thanks

16576077-function-png-1828×1217--01-09-2025_12_39_PM.png
January 9, 2025 at 7:12 am #16576151

恺 黄

Thank you very much for your assistance, after I added the ajax code and cleared the cache, the front end of the site took effect and the price was successfully switched to USD.
Now I have another query about this popup product image, the product is not showing the main image after translation, it needs me to go to the WooCommerce product list and click on Edit to enter and then click on Update for the front end page to take effect. Do all products need to do this to work, is there any other solution.

Also, I added the ajax code for the Astra theme files, does wordpress overwrite this code after updating the Astra theme?

Prodrcts02.png
Prodrcts01.png
January 9, 2025 at 7:15 am #16576182

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

For the images, please follow the steps as mentioned:

- Go to WPML->Settings->Media Translation
- Check the following options
-- Translate existing media in all languages
-- Duplicate existing media for translated content
-- Duplicate the featured images for translated content
- Click on the start button and wait for it to finish.

This should help you to show the images properly.

Regarding the code, yes, it will be removed when astra theme will update, you can either use child theme or use some custom snippets plugins to prevent this.

Thanks