Greetings PS community,
I'm a relatively new PHP dev with zero experience in Prestashop, I've only been using it for a week.
With my project, I'm trying to add a few currencies, modifying the currency's displayName & symbol to something else in translations/cldr/main--en-US--currencies, then allow users to choose which currency in the Front Office except for the default currency, which is USD.
The error that I encountered (as in the attachment), was after I've modified the classes/controllers/FrontController.php file.
I've changed the original code on line 350 in the file from this :
$currency = Tools::setCurrency($this->context->cookie);
to this :
$currency = Currency::getCurrencyInstance(i);
* the "i" represents number from 1 - 6, which were the id for the currencies I've added.
The error occurs after I switched the code back to the original code & have multiple currencies enabled.
I really have no clue how to get it to work as it were before.
If you can tell what went wrong or if you need more information, please let me know.
Thank you for taking your time to read this.
UPDATE :
The ContectErrorException no longer shows when Debug Mode is disabled but I am still unable to change currency & I would get Error 502.
I'd also get this in the nginx error log :
2019/01/17 15:49:16 [error] 697#697: *3693 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: current in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 38 PHP message: PHP Notice: Undefined index: url in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 40 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on lin 2019/01/17 15:49:16 [error] 697#697: *3693 upstream sent too big header while reading response header from upstream, client: xxx.xxx.xxx.xx, server: store.sinegy.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "store.sinegy.com" 2019/01/17 15:49:18 [error] 697#697: *3695 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: current in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 38 PHP message: PHP Notice: Undefined index: url in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 40 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on lin 2019/01/17 15:49:18 [error] 697#697: *3695 upstream sent too big header while reading response header from upstream, client: xxx.xxx.xxx.xx, server: store.sinegy.com, request: "GET /index.php?id_lang=1&SubmitCurrency=1&id_currency=7 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "store.sinegy.com", referrer: "https://store.sinegy.com/index.php" 2019/01/17 15:49:20 [error] 697#697: *3693 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: current in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 38 PHP message: PHP Notice: Undefined index: url in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 40 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on lin 2019/01/17 15:49:22 [error] 697#697: *3698 open() "/var/www/html/sinegy_store/themes/core.js.map" failed (2: No such file or directory), client: xxx.xxx.xxx.xx, server: store.sinegy.com, request: "GET /themes/core.js.map HTTP/1.1", host: "store.sinegy.com" 2019/01/17 15:49:24 [error] 697#697: *3693 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: current in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 38 PHP message: PHP Notice: Undefined index: url in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 40 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on lin 2019/01/17 15:49:25 [error] 697#697: *3700 open() "/var/www/html/sinegy_store/themes/core.js.map" failed (2: No such file or directory), client: xxx.xxx.xxx.xx, server: store.sinegy.com, request: "GET /themes/core.js.map HTTP/1.1", host: "store.sinegy.com" 2019/01/17 15:49:28 [error] 697#697: *3693 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: current in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 38 PHP message: PHP Notice: Undefined index: url in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 40 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 71 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'value' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Trying to get property 'id_currency' of non-object in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on line 77 PHP message: PHP Notice: Undefined index: cookie in /var/www/html/sinegy_store/var/cache/prod/smarty/compile/b9/77/56/b97756c07f8c7dd53da6530f78f67ddd242f77c9_2.module.pscurrencyselectorpscurre.php on lin 2019/01/17 15:49:28 [error] 697#697: *3693 upstream sent too big header while reading response header from upstream, client: xxx.xxx.xxx.xx, server: store.sinegy.com, request: "GET /index.php?id_lang=1&SubmitCurrency=1&id_currency=7 HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.2-fpm.sock:", host: "store.sinegy.com", referrer: "https://store.sinegy.com/index.php"