This thread is resolved. Here is a description of the problem and solution.
Problem:
You want the translation column to always be visible on the WooCommerce product list in the admin area, but even after using a code snippet to unhide the column, no data is displayed in it.
Solution:
We recommend implementing a custom function to ensure the 'icl_translations' column is always visible and contains data. Here's a step-by-step guide:
1. Add the following function to your theme's functions.php file or a custom plugin:
function force_wpml_languages_column_visibility() {<br /> if (!function_exists('get_current_screen') || !is_admin()) {<br /> return;<br /> }<br /> $screen = get_current_screen();<br /> if ($screen && $screen->id === 'edit-product') {<br /> $user_id = get_current_user_id();<br /> $hidden_columns = get_user_meta($user_id, 'manageedit-productcolumnshidden', true);<br /> if (is_array($hidden_columns) && ($key = array_search('icl_translations', $hidden_columns)) !== false) {<br /> unset($hidden_columns[$key]);<br /> update_user_meta($user_id, 'manageedit-productcolumnshidden', $hidden_columns);<br /> }<br /> }<br />}<br />add_action('admin_init', 'force_wpml_languages_column_visibility', 20);
2. To ensure the translation icons are reinitialized correctly, add this additional function:
function reinitialize_wpml_translation_icons() {<br /> $screen = get_current_screen();<br /> if ($screen && $screen->id === 'edit-product') {<br /> ?><br /> <script type="text/javascript"><br /> jQuery(document).ready(function($) {<br /> setTimeout(function() {<br /> if (typeof WPML_Translate_Link_Targets !== 'undefined') {<br /> WPML_Translate_Link_Targets.init();<br /> }<br /> }, 500);<br /> });<br /> </script><br /> <?php<br /> }<br />}<br />add_action('admin_footer', 'reinitialize_wpml_translation_icons');
Please test this solution in a staging environment before applying it to your live site, as this custom code is a courtesy and not officially supported by us.
If this solution does not resolve your issue or seems outdated, we highly recommend 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. If further assistance is needed, please open a new support ticket at WPML support forum.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
This topic contains 3 replies, has 0 voices.
Last updated by 12 hours, 24 minutes ago.
Assisted by: Osama Mersal.