- סטטוס
- ממתין למפתח
- תוסף/ערכת עיצוב קשורים
- Event Tickets Plus
סקירה כללית של התקלה
כאשר אתה משתמש בתוסף Event Tickets Plus כדי ליצור אירוע חדש ולהוסיף לו כרטיסים, מקטע הכרטיסים אינו מופיע בעמוד האירוע המתורגם.
פתרון עוקף
לפני שתמשיך, בצע גיבוי מלא של האתר שלך:
- הוסף את קטע הקוד הבא אל WPML → הגדרות → הגדרות XML מותאמות אישית:
<wpml-config> <custom-fields> <custom-field action="copy">_ticket_end_date</custom-field> <custom-field action="copy">_ticket_start_date</custom-field> <custom-field action="copy">_tribe_ticket_capacity</custom-field> <custom-field action="copy">_tribe_ticket_show_description</custom-field> <custom-field action="copy">_tribe_ticket_version</custom-field> <custom-field action="copy">_tribe_tickets_ar_iac</custom-field> <custom-field action="copy">_tribe_tickets_meta</custom-field> <custom-field action="copy-once">_tribe_wooticket_for_event</custom-field> </custom-fields> </wpml-config> - הוסף את הקוד הבא לקובץ functions.php:
//WPML Workaround add_action( 'save_post', 'wpmldp_update_tribe_wooticket_for_event_meta', 999,3 ); function wpmldp_update_tribe_wooticket_for_event_meta( $post_id, $post, $update ) { // Only set for post_type = product if ( 'product' !== $post->post_type ) { return; } //Check if WPML and THe Events Calendar are enabled if (class_exists('SitePress')) { //Get the current ID on "_tribe_wooticket_for_event" meta $current_wooticket_id = get_post_meta($post_id, '_tribe_wooticket_for_event'); if ( $current_wooticket_id ) { //Get Post Language $wpml_post_language_details = apply_filters( 'wpml_post_language_details', NULL, $post_id ) ; $wpml_current_language = $wpml_post_language_details['language_code']; //Check if there is a translation for the $current_wooticket_id. If not, returns the original ID $translated_wooticket_id = apply_filters( 'wpml_object_id', $current_wooticket_id[0], 'page', FALSE, $wpml_current_language); //Update post meta with the translated ID if ($translated_wooticket_id) { update_post_meta( $post_id, '_tribe_wooticket_for_event', $translated_wooticket_id ); } } } return; } - צור את האירוע, והוסף לו כרטיסים.
- תרגם את האירוע.
- עבור אל מוצרים → כל המוצרים וערוך את הכרטיס.
- בצע שינוי קטן בכרטיס ושמור.
- תרגם את הכרטיס. זכור שאם האירוע כבר קיים, עליך רק לתרגם אותו לפני תרגום הכרטיס. אם שניהם כבר מתורגמים, בצע שינוי קטן בכרטיס המקורי, ולאחר מכן עדכן את התרגום.
אם אתה משתמש בתוסף The Events Calendar, יהיה עליך לשנות את השורה הזו:
$translated_wooticket_id = apply_filters( 'wpml_object_id', $current_wooticket_id[0], 'page', FALSE, $wpml_current_language);ל:
$translated_wooticket_id = apply_filters( 'wpml_object_id', $current_wooticket_id[0], 'tribe_events', FALSE, $wpml_current_language);
השלבים הבאים
Event Tickets Plus ו־WPML עדיין אינם תואמים לחלוטין, אך נשמח לעבוד בשיתוף פעולה עם הצוות של The Events Calendar כדי להשלים זאת. אם התאימות של תוסף זה ל־WPML חשובה לך, אנא יידע את הצוות של The Events Calendar דרך פורום התמיכה הציבורי שלהם, או ערוצי התמיכה הפרטיים ונוכל לנסות לקדם זאת יחד.