WOOT - WooCommerce Active Products Tables

Display Issues with Localized WordPress (Czech, Slovak, German, French)

Problem

WOOT (WooCommerce Products Tables) not displaying products correctly on sites using certain language localizations. The table appears empty or returns JSON parsing errors in the browser console.

Affected languages:

  • Czech (cs_CZ)
  • Slovak (sk_SK)
  • German (de_DE)
  • French (fr_FR)
  • Other languages that use typographic quotes

Root Cause

WordPress automatically converts standard ASCII quotes (") to localized typographic quotes (e.g., Czech „quotes” or German „Anführungszeichen”) through the wptexturize() function. This breaks JSON parsing because JSON requires standard ASCII double quotes.

Example of the problem:

// Valid JSON (works): 
{"name": "Product"} 
// Broken JSON (Czech localization): 
{„name": „Product"}

 

When WOOT returns product data as JSON, WordPress converts the quotes, making the JSON invalid and causing the JavaScript parser to fail.

Solution

Add this code to your theme’s functions.php file to disable quote conversion for problematic locales:

/**
 * Fix: Disable typographic quote conversion for AJAX requests
 * Resolves WOOT JSON parsing issues in Czech, Slovak, German, French locales
 */
add_action('init', function () {
    $locale = get_locale();
    $problematic_locales = ['cs_CZ', 'sk_SK', 'de_DE', 'fr_FR'];

    if (in_array($locale, $problematic_locales)) {
        add_filter('run_wptexturize', '__return_false');
    }
});

How It Works

  1. Detects current WordPress locale using get_locale()
  2. Checks if locale is in the list of problematic languages
  3. Disables wptexturize() function that converts quotes
  4. JSON remains valid with standard ASCII quotes
  5. WOOT can parse product data correctly

Alternative Solution (AJAX Only)

If you want to disable quote conversion only for AJAX requests (not site-wide):

add_action('init', function() {
    $locale = get_locale();
    $problematic_locales = ['cs_CZ', 'sk_SK', 'de_DE', 'fr_FR'];
    
    if (in_array($locale, $problematic_locales) && wp_doing_ajax()) {
        add_filter('run_wptexturize', '__return_false');
    }
});

Adding More Languages

If you experience the same issue with other languages, add them to the $problematic_locales array:

$problematic_locales = ['cs_CZ', 'sk_SK', 'de_DE', 'fr_FR', 'pl_PL', 'hu_HU'];

Verification

After adding the code:

  1. Clear browser cache
  2. Clear WordPress cache (if using cache plugin)
  3. Reload the page with WOOT table
  4. Check browser console (F12) – no JSON errors should appear
  5. Products should display correctly

Notes

  • This fix applies to all plugins that use JSON responses in these locales
  • Does not affect regular post/page content
  • Safe to use – only disables typographic quote conversion
  • Works with all WordPress versions