33 private $topDestinationCountries;
46 \
Magento\Directory\Model\TopDestinationCountries $topDestinationCountries =
null 51 $this->topDestinationCountries = $topDestinationCountries ?:
53 ->get(\
Magento\Directory\Model\TopDestinationCountries::class);
90 'formElement' =>
'input',
91 'label' =>
__(
'City'),
96 'formElement' =>
'select',
97 'label' =>
__(
'Country'),
103 'formElement' =>
'select',
104 'label' =>
__(
'State/Province'),
110 'formElement' =>
'input',
111 'label' =>
__(
'Zip/Postal Code'),
116 if (!isset(
$jsLayout[
'components'][
'checkoutProvider'][
'dictionaries'])) {
117 $jsLayout[
'components'][
'checkoutProvider'][
'dictionaries'] = [
118 'country_id' => $this->countryCollection->loadByStore()->setForegroundCountries(
119 $this->topDestinationCountries->getTopDestinations()
121 'region_id' => $this->regionCollection->addAllowedCountriesFilter()->toOptionArray(),
124 if (isset(
$jsLayout[
'components'][
'block-summary'][
'children'][
'block-shipping'][
'children']
125 [
'address-fieldsets'][
'children'])
127 $fieldSetPointer = &
$jsLayout[
'components'][
'block-summary'][
'children'][
'block-shipping']
128 [
'children'][
'address-fieldsets'][
'children'];
129 $fieldSetPointer = $this->merger->merge($elements,
'checkoutProvider',
'shippingAddress', $fieldSetPointer);
130 $fieldSetPointer[
'region_id'][
'config'][
'skipValidation'] =
true;
__construct(\Magento\Checkout\Block\Checkout\AttributeMerger $merger, \Magento\Directory\Model\ResourceModel\Country\Collection $countryCollection, \Magento\Directory\Model\ResourceModel\Region\Collection $regionCollection, \Magento\Directory\Model\TopDestinationCountries $topDestinationCountries=null)