Skip to content

Commit 764f729

Browse files
MAGETWO-96107: Additional blank option in country dropdown
- Delete blank line for single country
1 parent 77af5d6 commit 764f729

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Directory/Model/ResourceModel/Country/Collection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ public function getItemById($countryId)
205205

206206
/**
207207
* Add filter by country code to collection.
208+
*
208209
* $countryCode can be either array of country codes or string representing one country code.
209210
* $iso can be either array containing 'iso2', 'iso3' values or string with containing one of that values directly.
210211
* The collection will contain countries where at least one of contry $iso fields matches $countryCode.
@@ -297,7 +298,7 @@ public function toOptionArray($emptyLabel = ' ')
297298
}
298299
$options[] = $option;
299300
}
300-
if ($emptyLabel !== false && count($options) > 0) {
301+
if ($emptyLabel !== false && count($options) > 1) {
301302
array_unshift($options, ['value' => '', 'label' => $emptyLabel]);
302303
}
303304

0 commit comments

Comments
 (0)