Skip to content

Commit

Permalink
Merge branch 'feature/sort-issuers-by-name' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed Aug 31, 2021
2 parents 758016e + 3b0e21d commit a1665de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions app/code/community/Mollie/Mpm/Block/Payment/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,16 @@ public function getIssuerTitle($code)
return $this->__('Select Issuer');
}

/**
* @param \Mollie\Api\Resources\IssuerCollection $issuers
*/
public function sortIssuers($issuers)
{
$issuers->uasort(function($a, $b) {
return strcmp(strtolower($a->name), strtolower($b->name));
});

return $issuers;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ $method = $this->getMethodByCode($code);
<?php endif; ?>
<?php if ($listType == 'radio'): ?>
<ul>
<?php foreach ($method->issuers() as $issuer): ?>
<?php foreach ($this->sortIssuers($method->issuers()) as $issuer): ?>
<li>
<label>
<input type="radio" name="<?php echo $code; ?>_issuer" value="<?php echo htmlspecialchars($issuer->id); ?>" id="issuer_<?php echo htmlspecialchars($issuer->id); ?>" class="radio">
Expand Down

0 comments on commit a1665de

Please sign in to comment.