sultan karachotza Posted July 11, 2025 Share Posted July 11, 2025 Hello, I’m encountering an error in the PrestaShop 9 backend after installing via cPanel (Softaculous). The backend doesn’t work, and I get the following error: **Error**: An exception has been thrown during the rendering of a template ("PrestaShop\PrestaShop\Core\Context\CurrencyContext::__construct(): Argument #2 ($name) must be of type string, int given, called in /home3/carpetfa/staging.carpetfashion.gr/src/Core/Context/CurrencyContextBuilder.php on line 62"). Link to comment Share on other sites More sharing options...
Cezua Posted July 12, 2025 Share Posted July 12, 2025 Edit src/Core/Context/CurrencyContextBuilder.php around line 62, and cast integer fields to string explicitly. // Update to: $currencyContext = new CurrencyContext( (int) $currencyId, (string) $isoCode, (int) $precision, // ... ); Clear PrestaShop cache, then reload the backend. or install it manually by uploading the Zip file directly. 1 Link to comment Share on other sites More sharing options...
Mediacom87 Posted October 6, 2025 Share Posted October 6, 2025 (edited) Hello, Thank you for the solution. This code can be found at: https://github.com/PrestaShop/PrestaShop/blob/develop/src/Core/Context/CurrencyContextBuilder.php return new CurrencyContext( (int) $legacyCurrency->id, $localizedNames[$languageId] ?? reset($localizedNames), $legacyCurrency->getLocalizedNames(), $legacyCurrency->iso_code, $legacyCurrency->numeric_iso_code, (string) $legacyCurrency->getConversionRate(), $localizedSymbols[$languageId] ?? reset($localizedSymbols), $legacyCurrency->getLocalizedSymbols(), (int) $legacyCurrency->precision, $localizedPatterns[$languageId] ?? reset($localizedPatterns), $legacyCurrency->getLocalizedPatterns() ); Edited October 6, 2025 by Mediacom87 (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now