- סטטוס
- נפתר
- דווח עבור
- WPML Multilingual & Multicurrency for WooCommerce 5.1.2
- נפתר בגרסה
- WCML 5.2.0
- תגיות נושא
- Bug
סקירה כללית של התקלה
אם לקוח מבצע הזמנה בשפה משנית הכוללת מוצר משתנה של WooCommerce, מזהה (ID) המוצר המקורי והמזהה (ID) של המוצר המשתנה המתורגם מוצגים בהזמנה. במקום זאת, עליה להציג רק את מזהי (ID) המוצרים המקוריים.
פתרון עוקף
אנא צור גיבוי מלא של האתר שלך לפני שתמשיך.
- פתח את הקובץ …/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-orders.php.
- חפש את שורה 191.
- החלף את:
private function adjust_product_item_if_translated( $item, $language_to_filter ) { $product_id = $item->get_product_id(); $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $language_to_filter ); if ( $product_id && $product_id !== $translated_product_id ) { $item->set_product_id( $translated_product_id ); $item->set_name( get_post( $translated_product_id )->post_title ); return true; } return false; }בקטע הבא:private function adjust_product_item_if_translated( $item, $language_to_filter ) { $product_id = $item->get_product_id(); $translated_product_id = apply_filters( 'translate_object_id', $product_id, 'product', true, $language_to_filter ); $variation_id = $item->get_variation_id(); $translated_variation_id = apply_filters( 'translate_object_id', $variation_id, 'product_variation', true, $language_to_filter ); if ( $product_id && $product_id !== $translated_product_id ) { $item->set_product_id( $translated_product_id ); $item->set_name( get_post( $translated_product_id )->post_title ); //return true; } if ( $variation_id && $variation_id !== $translated_variation_id ) { $item->set_variation_id( $translated_variation_id ); $item->set_name( get_post( $translated_variation_id )->post_title ); // return true; } return true; }