- Trạng thái
- Đã giải quyết
- Được báo cáo cho
- WPML Multilingual & Multicurrency for WooCommerce 4.11.7
- Đã giải quyết trong
- 4.12.0
Tổng quan về lỗi
Khi bạn truy cập một phân loại bằng REST API, nó hiển thị sai ID.
Giải pháp tạm thời
Trong khi chúng tôi đang tiến hành khắc phục vĩnh viễn, bạn có thể thử giải pháp tạm thời sau:
- Trước khi tiếp tục, vui lòng tạo một bản sao lưu đầy đủ cho trang web của bạn
- Chỉnh sửa dòng 75 của /woocommerce-multilingual/classes/Rest/Wrapper/ProductTerms.php
- Thay thế đoạn mã sau:
$response->data['translations'] = Fns::map( $getTermId, $this->wpmlTermTranslations->get_element_translations( $termTaxonomyId, $trid ) );
- Bằng
remove_filter( 'terms_clauses', [ $this->sitepress, 'terms_clauses' ], 10 ); remove_filter( 'get_term', [ $this->sitepress, 'get_term_adjust_id' ], 1 ); $response->data['translations'] = Fns::map( $getTermId, $this->wpmlTermTranslations->get_element_translations( $termTaxonomyId, $trid ) ); add_filter( 'terms_clauses', [ $this->sitepress, 'terms_clauses' ], 10, 3 ); add_filter( 'get_term', [ $this->sitepress, 'get_term_adjust_id' ], 1 );
