File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -181,19 +181,24 @@ public function getResponseContactId()
181
181
/**
182
182
* Retrieve customer address
183
183
*
184
- * @param \Magento\Customer\Model\Customer $customer
184
+ * @param \Magento\Customer\Model\Customer|\Magento\Customer\Model\Data\Customer $customer
185
185
* @return array|mixed|bool
186
186
*/
187
187
protected function _getCustomerAddress ($ customer )
188
188
{
189
189
$ address = false ;
190
- if ($ customer ->getPrimaryBillingAddress ()) {
191
- $ address = $ customer ->getPrimaryBillingAddress ();
192
- } elseif ($ customer ->getPrimaryShippingAddress ()) {
193
- $ address = $ customer ->getPrimaryShippingAddress ();
194
- } elseif ($ customer ->getAddresses ()) {
190
+ if ($ customer instanceof \Magento \Customer \Model \Data \Customer) {
195
191
$ addresses = $ customer ->getAddresses ();
196
192
$ address = array_shift ($ addresses );
193
+ } else {
194
+ if ($ customer ->getPrimaryBillingAddress ()) {
195
+ $ address = $ customer ->getPrimaryBillingAddress ();
196
+ } elseif ($ customer ->getPrimaryShippingAddress ()) {
197
+ $ address = $ customer ->getPrimaryShippingAddress ();
198
+ } elseif ($ customer ->getAddresses ()) {
199
+ $ addresses = $ customer ->getAddresses ();
200
+ $ address = array_shift ($ addresses );
201
+ }
197
202
}
198
203
199
204
if ($ address ) {
You can’t perform that action at this time.
0 commit comments