@@ 309-316 (lines=8) @@ | ||
306 | if ($entity instanceof Region) { |
|
307 | /** @var \OroCRM\Bundle\MagentoBundle\Entity\Region $existingEntity */ |
|
308 | $existingEntity = $this->findRegionEntity($entity); |
|
309 | } elseif ($entity instanceof Customer && !$entity->getOriginId() && $this->existingEntity) { |
|
310 | /** |
|
311 | * Get existing customer entity |
|
312 | * As guest customer entity not exist in Magento as separate entity and saved in order |
|
313 | * find guest by customer email |
|
314 | */ |
|
315 | $existingEntity = $this->findExistingCustomerByContext($this->existingEntity); |
|
316 | } else { |
|
317 | $existingEntity = parent::findExistingEntity($entity, $searchContext); |
|
318 | } |
|
319 |
@@ 111-113 (lines=3) @@ | ||
108 | */ |
|
109 | protected function findExistingEntity($entity, array $searchContext = []) |
|
110 | { |
|
111 | if ($entity instanceof Customer && !$entity->getOriginId() && $this->existingEntity) { |
|
112 | return $this->findExistingCustomerByContext($this->existingEntity); |
|
113 | } |
|
114 | ||
115 | return parent::findExistingEntity($entity, $searchContext); |
|
116 | } |