- Trạng thái
- Đã được giải quyết bởi nhà phát triển
- Plugin/giao diện liên quan
- Germanized for WooCommerce
- Thẻ chủ đề
- Compatibility, WCML
Tổng quan về lỗi
Trong các thiết lập với Germanized for WooCommerce và WPML, có một sự cố trong đó các phương thức giao hàng sử dụng điều kiện Lớp giao hàng không khả dụng cho các sản phẩm đã dịch.
Giải pháp tạm thời
Vui lòng đảm bảo bạn có bản sao lưu toàn bộ trang web trước khi tiến hành.
- Mở tệp …/wp-content/plugins/woocommerce-germanized/packages/woocommerce-germanized-shipments/src/ShippingMethod/ShippingMethod.php.
- Tìm dòng 957.
- Thay thế:
$classes = isset( $condition['classes'] ) && ! empty( $condition['classes'] ) ? array_map( 'absint', (array) $condition['classes'] ) : array();
- Bằng:
$classes = isset( $condition['classes'] ) && ! empty( $condition['classes'] ) ? array_map( 'absint', (array) $condition['classes'] ) : array(); // compsupp-7583 workaround // Assuming $classes is an array of category IDs. $classes = array_map(function($class_id) { // Translate each ID using WPML return apply_filters('wpml_object_id', $class_id, 'category'); }, $classes);