/** * @param Order $order * @return bool */ protected function isProcessingAllowed(Order $order) { $isProcessingAllowed = true; $customer = $this->findExistingEntity($order->getCustomer()); $customerOriginId = $order->getCustomer()->getOriginId(); if (!$customer && $customerOriginId) { $this->appendDataToContext(ContextCustomerReader::CONTEXT_POST_PROCESS_CUSTOMERS, $customerOriginId); $isProcessingAllowed = false; } // Do not try to load cart if bridge does not installed /** @var MagentoSoapTransport $transport */ $channel = $this->databaseHelper->findOneByIdentity($order->getChannel()); $transport = $channel->getTransport(); if ($transport->getIsExtensionInstalled()) { $cart = $this->findExistingEntity($order->getCart()); $cartOriginId = $order->getCart()->getOriginId(); if (!$cart && $cartOriginId) { $this->appendDataToContext(ContextCartReader::CONTEXT_POST_PROCESS_CARTS, $cartOriginId); $isProcessingAllowed = false; } } if (!$customer && $order->getIsGuest() && $transport->getGuestCustomerSync()) { $this->appendDataToContext('postProcessGuestCustomers', $this->context->getValue('itemData')); $isProcessingAllowed = false; } return $isProcessingAllowed; }