#3481 [advs-module] Currency error when viewing an ad

This commit is contained in:
Diatrex 2021-03-04 16:27:12 +03:00
parent 21128aa5ee
commit 43c457a048

View File

@ -257,7 +257,7 @@ class AdvsController extends PublicController
$advs[$index] = $this->adv_model->AddAdsDefaultCoverImage($ad);
$foreign_currencies = json_decode($advs[$index]->foreign_currencies, true);
if ($_COOKIE['currency'] && $advs[$index]->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) {
if (isset($_COOKIE['currency']) && $_COOKIE['currency'] && $advs[$index]->foreign_currencies && array_key_exists($_COOKIE['currency'], $foreign_currencies)) {
$advs[$index]->currency = $_COOKIE['currency'];
$advs[$index]->price = $foreign_currencies[$_COOKIE['currency']];
}