• Hi,
    we are facing the following error:

    PHP Warning:  number_format() expects parameter 2 to be int, string given in /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php on line 65

    Running on PHP 8, on PHP 7.4 it even causes a fatal error.

    What can we do?

    Kind regards,
    Jan

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jan Wittler | Wittler Web GmbH

    (@bloggingwelt)

    Addition:

    It now even throws a fatal error on PHP 8 but i noticed it only appears when I upgrade Polylang from version 3.3 to the newest, when I restore back the problem is away. Here is the stacktrace:

    PHP Fatal error:  Uncaught TypeError: number_format(): Argument #2 ($decimals) must be of type int, string given in /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php:65
    Stack trace:
    #0 /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php(65): number_format(270, '', ',', '.')
    #1 /wp-content/plugins/wp-travel-engine/includes/helpers/class-wte-price.php(51): wte_number_format(270)
    #2 /wp-content/plugins/wp-travel-engine/includes/helpers/class-wte-price.php(39): WPTravelEngine\Utilities\Price->get_formated_number(270)
    #3 /wp-content/plugins/wp-travel-engine/includes/helpers/class-wte-price.php(67): WPTravelEngine\Utilities\Price->replacer(270)
    #4 /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php(108): WPTravelEngine\Utilities\Price->format(true)
    #5 /wp-content/plugins/travel-agency-companion/includes/class-travel-agency-companion-functions.php(132): wte_get_formated_price(270)
    #6 /wp-content/plugins/travel-agency-companion/public/sections/popular.php(91): Travel_Agency_Companion_Functions->travel_agency_trip_symbol_options(4520, 'EUR', '€')
    #7 /wp-content/themes/travel-agency-pro/inc/extras.php(270): require_once('...')
    #8 /wp-content/themes/travel-agency-pro/front-page.php(23): travel_agency_pro_get_template_part('popular')
    #9 /wp-includes/template-loader.php(106): include('...')
    #10 /wp-blog-header.php(19): require_once('...')
    #11 /index.php(17): require('...')
    #12 {main}
      thrown in /wp-content/plugins/wp-travel-engine/includes/helpers/helpers-prices.php on line 65
    Plugin Support Manjil Nepali

    (@manjilnepali)

    Hello @bloggingwelt,

    Thank you for contacting WP Travel Engine team!

    The error you’ve encountered is related to an empty field under “Decimal digits”. You can resolve this issue by entering a numerical value for Decimal Digits in your admin dashboard. To do this, please navigate to Admin Dashboard > WP Travel Engine > Settings > MISCELLANEOUS > Currency Settings. Once you’ve added the required value, kindly verify if the issue persists. You can refer to this screenshot for assistance: https://prnt.sc/O9SuWwjWuf–

    Your cooperation in resolving this matter is greatly appreciated.

    If you have any queries or confusion later, please let us know, and we will be back.

    Thank you!

    Thread Starter Jan Wittler | Wittler Web GmbH

    (@bloggingwelt)

    Hi @manjilnepali,

    Thank you for your great support!

    The issue is resolved now after I replaced the value 0 by 2.

    Have a great day!

    Kind regards,
    Jan

    Plugin Support Manjil Nepali

    (@manjilnepali)

    Hello @bloggingwelt,

    I’m glad I could assist you. I have a small favor to ask. Would you consider sharing your experience with WP Travel Engine by writing a review on www.remarpro.com?

    Click here to leave a review for WP Travel Engine on www.remarpro.com.

    Upon clicking the link, you’ll be directed to our service review page. Please select a rating that best describes your experience with us. It’ll take less than 5 minutes of your time.

    Your feedback helps us better cater to your needs and guides others in making informed decisions about WP Travel Engine. Whether or not you choose to leave a review, please know that we deeply value your trust in us.

    I look forward to assisting you again in the future!

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘number_format() PHP error’ is closed to new replies.