diff --git a/plugin/buycourses/src/BuyCoursesUtils.php b/plugin/buycourses/src/BuyCoursesUtils.php index fa02c26fc2..52bf1b4aee 100644 --- a/plugin/buycourses/src/BuyCoursesUtils.php +++ b/plugin/buycourses/src/BuyCoursesUtils.php @@ -72,10 +72,10 @@ class BuyCoursesUtils ' => ', [ $currency['country_name'], - $currency['currency_code'] + $currency['iso_code'] ] ); - $currencyValue = $currency['country_id']; + $currencyValue = $currency['id']; $currencySelect->addOption($currencyText, $currencyValue); diff --git a/plugin/buycourses/src/buy_course_plugin.class.php b/plugin/buycourses/src/buy_course_plugin.class.php index e0a443fc67..7a87e0ee31 100644 --- a/plugin/buycourses/src/buy_course_plugin.class.php +++ b/plugin/buycourses/src/buy_course_plugin.class.php @@ -85,7 +85,7 @@ class BuyCoursesPlugin extends Plugin { return Database::select( '*', - Database::get_main_table(BuyCoursesUtils::TABLE_COUNTRY), + Database::get_main_table(BuyCoursesUtils::TABLE_CURRENCY), [ 'where' => ['status = ?' => true] ], @@ -101,7 +101,7 @@ class BuyCoursesPlugin extends Plugin { return Database::select( '*', - Database::get_main_table(BuyCoursesUtils::TABLE_COUNTRY) + Database::get_main_table(BuyCoursesUtils::TABLE_CURRENCY) ); } @@ -111,16 +111,18 @@ class BuyCoursesPlugin extends Plugin */ public function selectCurrency($selectedId) { - $countryTable = Database::get_main_table(BuyCoursesUtils::TABLE_COUNTRY); + $currencyTable = Database::get_main_table( + BuyCoursesUtils::TABLE_CURRENCY + ); Database::update( - $countryTable, + $currencyTable, ['status' => 0] ); Database::update( - $countryTable, + $currencyTable, ['status' => 1], - ['country_id = ?' => intval($selectedId)] + ['id = ?' => intval($selectedId)] ); }