This user has no favorite topics.
Favorite Forum Topics
Forum Topics Created
| Status |
Topic
|
Supporter | Voices | Posts | Freshness |
|---|---|---|---|---|---|
|
Variation_id changed with update
Started by: ivanV-42
in: English Support
Problem: add_filter('woocommerce_rest_prepare_shop_order_object', 'force_variation_ids_to_default_language', 10, 3);<br />function force_variation_ids_to_default_language($response, $order, $request) {<br /> if (!is_a($order, 'WC_Order')) return $response;<br /> $default_lang = function_exists('wpml_get_default_language') ? wpml_get_default_language() : 'nl';<br /> $order_lang = $order->get_meta('wpml_language');<br /> if ($order_lang && $order_lang !== $default_lang) {<br /> foreach ($response->data['line_items'] as $index => $item) {<br /> if (!empty($item['variation_id'])) {<br /> $current_variation_id = $item['variation_id'];<br /> $default_variation_id = apply_filters('wpml_object_id', $current_variation_id, 'product_variation', false, $default_lang);<br /> if ($default_variation_id) {<br /> $response->data['line_items'][$index]['variation_id'] = (int) $default_variation_id;<br /> }<br /> }<br /> if (!empty($item['product_id'])) {<br /> $current_product_id = $item['product_id'];<br /> $default_product_id = apply_filters('wpml_object_id', $current_product_id, 'product', false, $default_lang);<br /> if ($default_product_id) {<br /> $response->data['line_items'][$index]['product_id'] = (int) $default_product_id;<br /> }<br /> }<br /> }<br /> }<br /> return $response;<br />}We didn't check this solution or had the chance to get to the bottom of this case. Please use it only if you are certain it can help in your case. And please take a backup of your site before proceeding. |
|
0 | 3 | 9 months, 1 week ago | |
|
Some of the products are rejected in Merchant Center
Started by: ivanV-42
in: English Support
Problem: If this solution does not apply to your case, or if it seems outdated, we recommend opening a new support ticket. We also highly suggest checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please contact us through the WPML support forum. |
|
0 | 2 | 11 months, 1 week ago |