Skip to content
Open
Changes from 1 commit
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
Next Next commit
Fix Only variables should be passed by reference
Fix #333 - Only variables should be passed by reference on line 107
  • Loading branch information
r-martins authored Jan 9, 2019
commit ce2b7e88e55de80194be81ed144825638b85de0c
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;
}
}