Disappearing product variations – possible cause found
-
We are having troubles with disappearing product variations on the front end from time to time. There are some support entries on this topic, but none of the usual debugging steps permanently resolved our issue. So I started to dig into the code and I found out, that WooCommerce stores product variations in a transient wc_product_children_{parent_id}. The transient is created in class-wc-product-variable-data-store-cpt.php in the read_children() function.
It appears, that sometimes this function is called in the wrong language and therefore the wrong product variations are stored in the transient. In our case, the transient for the German parent product contained the IDs of the English variations.
A possible solution for this would be to hook into woocommerce_variable_children_args and make sure that the transient is saved with the correct language.
- The topic ‘Disappearing product variations – possible cause found’ is closed to new replies.