• Resolved jnlr

    (@jonathanlo)


    I’m not able to see my product variations in backend.

    Uncaught ValueError: Unknown format specifier “a” in /home/u244729659/domains/example.com/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php:120

    “error”: { “type”: 1, “file”: “/home/u244729659/domains/example.com/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php”, “line”: 120 }, “backtrace”: [ “”, “#0 /home/u244729659/domains/example.com/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php(120): sprintf()”, “#1 /home/u244729659/domains/example.com/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-data.php(182): include(‘/home/u24472965…’)”, “#2 /home/u244729659/domains/example.com/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-panel.php(53): WC_Meta_Box_Product_Data::output_variations()”, “#3 /home/u244729659/domains/example.com/public_html/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-product-data.php(33): include(‘/home/u24472965…’)”, “#4 /home/u244729659/domains/example.com/public_html/wp-admin/includes/template.php(1456): WC_Meta_Box_Product_Data::output()”, “#5 /home/u244729659/domains/example.com/public_html/wp-admin/edit-form-advanced.php(723): do_meta_boxes()”, “#6 /home/u244729659/domains/example.com/public_html/wp-admin/post.php(206): require(‘/home/u24472965…’)”, “#7 {main}”, “thrown” ]

    I didn’t modify any source code.

    And it’s impossible to order in frontend, what is really blocking my business
    Thanks for helping.

    I’ve already tested :

    • deactivate all plugins : same.
    • change my theme for storefront : same
    • rollback WC in 9.1 : same
    • rollback WP core un 9.5.5 : same
    • This topic was modified 1 year, 9 months ago by jnlr.
    • This topic was modified 1 year, 9 months ago by jnlr. Reason: personal informations
    • This topic was modified 1 year, 9 months ago by jnlr.
    • This topic was modified 1 year, 9 months ago by jnlr.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there,

    Thank you for reaching out.

    I understand you’re facing issues with product variations in your store.

    Looking at the shared error message, this issue looks related to a PHP error in your site. Since you’ve already tried deactivating all plugins, changing your theme, and rolling back WooCommerce and WordPress to previous versions without success, I would suggest the following steps:

    1. Create a full site backup. This is essential in case anything goes wrong during the troubleshooting process.
    2. Check the PHP version of your server. WooCommerce recommends using PHP 7.4 or greater as described here.
    3. If the issue persists, you might need to re-install the WooCommerce plugin. Please remember to back up your data before doing this.

    Please try these steps and let us know how it goes.

    I’m getting the same error with no variation. But this only happened for a user with French as selected Language. For the English User, all works fine.

    PHP Fatal error:  Uncaught ValueError: Unknown format specifier "a" in /var/customers/webs/indrya/public/wp-content/plugins/woocommerce/includes/admin/meta-boxes/views/html-product-data-variations.php:120

    After I comment out this line, 120

    <span class="displaying-num"><?php echo esc_html( sprintf( _n( '%s item', '%s items', $variations_count, 'woocommerce' ), $variations_count ) ); ?></span>

    with

     <span class="displaying-num"><?php /* echo esc_html( sprintf( _n( '%s item', '%s items', $variations_count, 'woocommerce' ), $variations_count ) ); */ ?></span>

    it’s working.

    Hi @veto ,

    Thanks for sharing those details! It’s great to hear that the issue is isolated to specific language settings on your end. Insights like these are so valuable for understanding and tackling problems.

    It looks like the error is tied to the formatting specifier in the code you mentioned. You’ve done an amazing job spotting the problematic line and finding a temporary fix! That’s a smart way to keep things running smoothly.

    This might be happening because of a mismatch in the French translation strings. Updating your WooCommerce plugin and double-checking that all related translations are up to date could help. If it still doesn’t fix the problem, it might be worth checking for any custom translation files or plugin conflicts that could be affecting the variation count display.

    Thanks again for sharing this with us, let us know if you need any further help. 😊

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Product variations doesn’t display’ is closed to new replies.