• Resolved raidenelite

    (@raidenelite)


    Hello,

    i kept having this error in my logs:
    Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /httpdocs/wp-content/plugins/woo-product-feed-pro/classes/class-get-products.php:3373

    so i added some logging and find out that the code at that line, which is:

    $product_data[ $rounded_key ] = round( number_format( $product_data[ $price_key ], $number_of_decimals, $decimal_separator, $thousand_separator ), $rounded_precisions, $rounded_mode );

    returned a string to round(), if you give a number to number_format say like 20000 (the one i had problems with), it will return 20.000,00, but round() wants a int

    i fixed it by doing round first and format later

    $product_data[ $rounded_key ] = number_format( round( $product_data[ $price_key ], $rounded_precisions, $rounded_mode ), $number_of_decimals, $decimal_separator, $thousand_separator );

    now i can generate my feeds, because before i couldn’t..
    Can you please check on this further and see if it actually requires a fix?

    Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.