Salta la navigazione

Questo thread è stato risolto. Ecco una descrizione del problema e della soluzione.

Problem:
If a variable product is purchased in a secondary language and the stock is reset to zero, the 'out of stock' label appears only in that language. In other languages, the product still appears as available in the backend, despite all variants having a stock count of zero.
Solution:
We acknowledge that this issue has not been resolved yet. You can find a workaround here: WooCommerce Multilingual - Variable product stock status is not updated when it gets out of stock in the second language.

If this solution does not seem relevant to your situation, please open a new support ticket with us.

Questo è il forum di assistenza tecnica di WPML, il plug-in multilingue di WordPress.

La sua lettura è permessa a tutti, ma la pubblicazione è riservata esclusivamente ai clienti di WPML. Il team di WPML risponde sul forum 6 giorni su 7, 22 ore su 24.

Etichettato: 

Questo ticket contiene 1 risposta, ha 2 voci.

Ultimo aggiornamento da Laura 1 anno, 7 mese fa.

Assistito da: Laura.

Autore Post
Novembre 16, 2023 alle 2:12 pm #14827737

Franco Becattini

Hi, as indicated in the title, the problem concerns the fact that if a product is purchased in a secondary language and the stock is reset, only in that language does the out of stock label appear, while in the rest of the languages ​​in the backend the product appears with an available status, although all variants have stock at 0. All the products on the site are of a variable type.

I have already found a thread relating to my request at this link: https://wpml.org/forums/topic/stock-status-doesnt-change-when-order-placed-on-2nd-language/ and have read it.

I would like to better understand what is happening and possibly whether the problem has been fixed on the new versions of the WPML + Woocommerce ecosystem plugins.

Inside the thread it is indicated to comment out a part of the "sync_stock_status_for_translations" function, in particular the "if ( $this->woocommerce_wpml->products->is_original_product( $product_id ) )" condition.
Can you confirm that this function checks that the stock_status is changed to a product in the main language of the site?
If so, why was this condition originally set? I would like to be sure that changing it as indicated in the fix does not corrupt part of the flow.

Thanks.

Lorenzo

Novembre 16, 2023 alle 3:27 pm #14828355

Laura
Sostenitore di WPML dal 05/2018

Lingue: Inglese (English ) Italiano (Italiano )

Fuso orario: Europe/Rome (GMT+02:00)

Salve,

grazie per averci contattato.

Il problema non è ancora stato risolto. Sul perché succeda non so dirti perché appunto ancora i dev non hanno fatto un debugging completo.

Il workaround è sicuro, ovviamente prima di applicarlo fai un backup.