@@ -51,40 +51,56 @@ public function __construct(
51
51
public function process ($ jsLayout )
52
52
{
53
53
if ($ this ->carrierFactory ->getIfActive ($ this ->methodCode )) {
54
- // @codingStandardsIgnoreStart
55
- $ storeDelivery = $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
56
- ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
57
- ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
58
- ['children ' ]['store-delivery ' ];
59
- // @codingStandardsIgnoreEnd
60
-
61
- $ storeDelivery ['provider ' ] = $ this ->map ->getIdentifier ();
62
- $ storeDelivery ['markers ' ] = $ this ->getStores ();
63
- $ storeDelivery = array_merge ($ storeDelivery , $ this ->map ->getConfig ());
64
-
65
- // @codingStandardsIgnoreStart
66
- $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
67
- ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
68
- ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
69
- ['children ' ]['store-delivery ' ] = $ storeDelivery ;
70
- // @codingStandardsIgnoreEnd
71
-
72
- // @codingStandardsIgnoreStart
73
- $ geocoder = $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
74
- ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
75
- ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
76
- ['children ' ]['store-delivery ' ]['children ' ]['geocoder ' ];
77
- // @codingStandardsIgnoreEnd
78
-
79
- $ geocoder ['provider ' ] = $ this ->map ->getIdentifier ();
80
- $ geocoder = array_merge ($ geocoder , $ this ->map ->getConfig ());
81
-
82
- // @codingStandardsIgnoreStart
83
- $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
84
- ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
85
- ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
86
- ['children ' ]['store-delivery ' ]['children ' ]['geocoder ' ] = $ geocoder ;
87
- // @codingStandardsIgnoreEnd
54
+ $ markers = $ this ->getStores ();
55
+
56
+ if ($ markers ) {
57
+ // @codingStandardsIgnoreStart
58
+ $ storeDelivery = $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
59
+ ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
60
+ ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
61
+ ['children ' ]['store-delivery ' ];
62
+ // @codingStandardsIgnoreEnd
63
+
64
+ $ storeDelivery ['provider ' ] = $ this ->map ->getIdentifier ();
65
+ $ storeDelivery ['markers ' ] = $ markers ;
66
+ $ storeDelivery ['searchPlaceholderText ' ] = $ this ->storeLocatorHelper ->getSearchPlaceholder ();
67
+ $ storeDelivery = array_merge ($ storeDelivery , $ this ->map ->getConfig ());
68
+
69
+ // @codingStandardsIgnoreStart
70
+ $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
71
+ ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
72
+ ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
73
+ ['children ' ]['store-delivery ' ] = $ storeDelivery ;
74
+ // @codingStandardsIgnoreEnd
75
+
76
+ // @codingStandardsIgnoreStart
77
+ $ geocoder = $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
78
+ ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
79
+ ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
80
+ ['children ' ]['store-delivery ' ]['children ' ]['geocoder ' ];
81
+ // @codingStandardsIgnoreEnd
82
+
83
+ $ geocoder ['provider ' ] = $ this ->map ->getIdentifier ();
84
+ $ geocoder = array_merge ($ geocoder , $ this ->map ->getConfig ());
85
+
86
+ // @codingStandardsIgnoreStart
87
+ $ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
88
+ ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
89
+ ['rendererTemplates ' ]['store-delivery ' ]['children ' ]['smile-store-delivery ' ]
90
+ ['children ' ]['store-delivery ' ]['children ' ]['geocoder ' ] = $ geocoder ;
91
+ // @codingStandardsIgnoreEnd
92
+ }
93
+
94
+ // unset store-delivery if $markers found
95
+ if (!$ markers ) {
96
+ unset($ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
97
+ ['shipping-step ' ]['children ' ]['shippingAddress ' ]['children ' ]['address-list ' ]
98
+ ['rendererTemplates ' ]['store-delivery ' ]);
99
+ unset($ jsLayout ['components ' ]['checkout ' ]['children ' ]['steps ' ]['children ' ]
100
+ ['shipping-step ' ]['children ' ]['smile-store-delivery-address-provider ' ]);
101
+ unset($ jsLayout ['components ' ]['checkout ' ]['children ' ]['sidebar ' ]['children ' ]
102
+ ['shipping-information ' ]['children ' ]['ship-to ' ]['rendererTemplates ' ]['store-delivery ' ]);
103
+ }
88
104
}
89
105
90
106
return $ jsLayout ;
@@ -118,6 +134,8 @@ private function getStores(): array
118
134
'directionUrl ' => $ this ->map ->getDirectionUrl ($ address ->getCoordinates ()),
119
135
'setStoreData ' => $ this ->getSetStorePostData ($ retailer ),
120
136
'addressData ' => $ address ->getData (),
137
+ 'postCode ' => $ address ->getPostcode (),
138
+ 'city ' => $ address ->getCity (),
121
139
];
122
140
123
141
// phpcs:ignore Magento2.Performance.ForeachArrayMerge.ForeachArrayMerge
0 commit comments