Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions app/code/community/Ebanx/Gateway/Block/Health/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,21 @@ public function hasAnySupportedCurrency()
$this->supportedCurrencies = Currency::all();

try {
array_walk(Mage::app()->getStores(), function ($store) {
if (in_array(Mage::app()->getStore($store->store_id)->getCurrentCurrencyCode(), $this->supportedCurrencies)) {
throw new Exception;
$stores = Mage::app()->getStores();
$currentSupportedCurrencies = [];
foreach ($stores as $store) {
$currentCurrencyCode = $store->getCurrentCurrencyCode();
if (in_array($currentCurrencyCode, $this->supportedCurrencies)) {
$currentSupportedCurrencies[] = $currentCurrencyCode;
}
});
} catch (\Exception $e) {
}
if (count($currentSupportedCurrencies) == 0) {
return '<strong>Currency not supported: </strong> Your website must support one of these currencies '
. implode(', ', $this->supportedCurrencies) . '.';;
}
} catch (Exception $e) {
return true;
}
return '<strong>Currency not supported: </strong> Your website must support one of these currencies ' . implode(', ', $this->supportedCurrencies) . '.';
return true;
}
}