Skip Navigation

هنا منتدى الدعم الفني لـ WPML - ملحق WordPress متعدد اللغات.

يمكن للجميع قراءة المواضيع، ولكن عملاء WPML فقط هم من يمكنهم النشر هنا. يقوم فريق WPML بالرد على موضوعات المنتدى على مدار 6 أيام في الأسبوع، 22 ساعة في اليوم.

Our next available supporter will start replying to tickets in about 0.19 hours from now. Thank you for your understanding.

This topic contains رد واحد, has مشارك واحد.

Last updated by Mohamed Sayed قبل 2 أيام، 10 ساعة.

Assigned support staff: Mohamed Sayed.

الكاتب المشاركات
مارس 31, 2021 at 7:32 ص #8436833

rayanA-4

I had a problem synchronizing the rates. I use two languages (English and Arabic). My default language is English. I have made the configuration in Booking (in English) as follows:
1. Create rooms. (Translation from English to Arabic)
2. Create seasons. (Translation from English to Arabic)
3. Put all prices in the accommodation section.
4. I did not translate the Booking in the multi-language content setting.

My issue is why the room rates are out of sync with the Arabic rate.

مارس 31, 2021 at 11:03 ص #8439215

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

,Hi Rayan
.Thanks for contacting WPML support

1. Please provide your WPML debug information
You can find it in WPML > Support > click on “Debug information” link. Please check this link for more info: http://wpml.org/faq/provide-debug-information-faster-support/

2. Could you please send me a link to the page where I can see the issue? It will be also
helpful if you can send a screenshot of where the room rates are inserted

,Regards
Mohamed

أبريل 1, 2021 at 7:21 ص #8445783

rayanA-4

Let me know If you have any question about the screenshots

h4(Arabic harm view).PNG
h3(single haram view).PNG
h2(single haram view).PNG
h1(single haram view).PNG
أبريل 1, 2021 at 11:21 ص #8448269

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Rayan

Please try the following:
1. Edit the Accommodation in the default language
2. Scroll down to the "Multilingual Content Setup" -> Custom Fields
3- Make sure that "shb_pricing" is set to copy
4. Make a small change to the accommodation, save it, then update the translation

Please check and let me know if that helps.
Regards
Mohamed

أبريل 1, 2021 at 4:15 م #8450505

rayanA-4

Still the same.
Tell me about the seasons--> whats option can I choose copy or translate?

p2.PNG
p1.PNG
أبريل 4, 2021 at 1:30 م #8463525

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Rayan
Sorry for the late reply.

Please try with the "copy" option, then make a small change to the season in the default language, save it and update the translation.

Let me know please if that works for you.

أبريل 4, 2021 at 6:45 م #8463997

rayanA-4

It is still the same. Also, the English season does not affect the Arabic language.
What is the best way to collaborate to end this problem faster?

أبريل 4, 2021 at 9:01 م #8464153

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Rayan

1. Can you please provide me with the WordPress debug.log? It will show us if any errors are triggered that could refer to a conflict issue.

  • To enable it, open your wp-config.php file and look for:
    define('WP_DEBUG', false);
    

    And change it to:

    define('WP_DEBUG', true);
    // Enable Debug logging to the /wp-content/debug.log file
    define('WP_DEBUG_LOG', true);
    // Disable display of errors and warnings which is recommened on a live site.
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors',0);
    
  • Then check if any errors were saved to the debug.log log file inside the /wp-content/ directory
  • If you can paste your debug.log to https://pastebin.com/ and provide me that link, it would be great!
    (This is the cleanest way because sometimes the logs are long and create a complete mess in discussion).

2. I would need also to request temporary access (WP-Admin) to investigate this issue further
– preferably to a test site where the problem has been replicated if possible –

Your next answer will be private, which means only you and I have access to it.

❌ Please backup your database and website before providing us with access details ❌

Regards,
Mohamed

أبريل 5, 2021 at 5:32 م #8468109

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Rayan
Thanks for providing the access details.

It seems like the WordPress user account you provided is not having the administrator role, so I wasn't able to access the theme or the WPML settings.

However, I was able to find the same issue reported before and it was escalated to our 2nd tier support team who found that it's an issue with the theme itself and provided a workaround to fix it with a custom snippet.
https://wpml.org/forums/topic/deny-custom-field-translation/page/3/#post-5404603

So please create a full backup, then edit the functions.php file of the child theme and add the following code

add_action( 'wpml_after_copy_custom_field', function($post_id_from, $post_id_to, $meta_key){
    if ($meta_key == 'shb_pricing') {
        $translated_lang = apply_filters( 'wpml_post_language_details', '', $post_id_to );
        $translated_lang = isset($translated_lang['language_code']) ? $translated_lang['language_code'] : ''; 
        
	$original_value = get_post_meta($post_id_from, 'shb_pricing', true);
	$translated_value = $original_value;
	
	if (!empty($original_value) && is_array($original_value)) {
	    foreach ($original_value as $key => $value) {
		$session_id = intval(substr($key, 7));
		if ( !empty($session_id) ) {
		    $session_id = apply_filters( 'wpml_object_id', $session_id, 'shb_season', false, $translated_lang );
		    $translated_value['season_' . $session_id] = $translated_value[$key];
		    unset($translated_value[$key]);
		}
	    }
	    
	    update_post_meta($post_id_to, 'shb_pricing', $translated_value);
	}
    }
}, 10, 3);

Then save the file and check if the issue is resolved

Let me know please if this helps
Regards
Mohamed

أبريل 6, 2021 at 7:43 ص #8471075

rayanA-4

Hello Mohamed,

Apologies to you. Now you can access full control with the user which I have mentioned in the last reply. Still, I face the same issue.

أبريل 7, 2021 at 8:02 ص #8479461

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Rayan,

I checked the WPML and the theme settings and couldn't find any clues, everything seems to be fine.

Can you please confirm that you've added the custom snippet I shared in my previous reply to the functions.php file of your child theme؟

Please also recheck the FTP credentials, I can't access to check the file and the theme editor is disabled on the back-end

أبريل 7, 2021 at 9:16 ص #8480403

rayanA-4

I'd like to give you another password. How to send a private message?

أبريل 7, 2021 at 10:44 ص #8481449

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

I've enabled the private answer for your next reply, please share the new credentials

أبريل 8, 2021 at 1:51 م #8493239

Mohamed Sayed
Supporter

Languages: الإنجليزية (English ) العربية (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi Rayan,

I checked the site again and found that many of the custom fields are set to "Translate" while they be set to "copy" instead

So we will need to investigate the issue further on our server to find out if it's a bug or an issue with the configuration WPML

I have created this clean sandbox setup on our servers here:
hidden link (one-click login).

I would need you to please set up WPML + the WPML add-ons as you have them on your site (they are already installed) and to also install the theme and try to recreate the issue

Please don't install anything else like plugins that are not necessary, on a clean sandbox we try to use just the WPML plugins and the plugin/theme that's part of the issue.

If the issue is going to take place on this clean setup on our servers too, then I can forward this to our compatibility department.

Please let me know how that goes and what you are able to find.

I will be waiting for your response.

Kind regards,
Mohamed

أبريل 10, 2021 at 11:45 ص #8506497

rayanA-4

Thank you very much for your help. I appreciate you. As per your instructions, I uploaded the theme and created rooms and seasons. I have translated rooms and seasons. I have set shp_price multilingual for copy. When I try to put the price in the accommodation section. Copied into Arabic successfully with the default price, but the price was not copied in the season (Ramadan).