getShipping example

$this->getOrder();

        $this->initializeShopContext((int) $this->_order['language']);
        $this->countryGateway = Shopware()->Container()->get(CountryGatewayInterface::class);
        $this->structConverter = Shopware()->Container()->get(LegacyStructConverter::class);

        $this->getPositions();

        $this->getUser();
        $this->getBilling();
        $this->getShipping();
        $this->getDispatch();
        $this->getPayment();
        $this->getPaymentInstances();

        $this->processPositions();
        $this->processOrder();
    }

    /** * Convert this object into an array * * @return array<string, mixed> */
        if (!($order instanceof Order)) {
            $this->View()->assign([
                'success' => false,
                'data' => $this->Request()->getParams(),
                'message' => $namespace->get('no_order_id_passed', 'No valid order id passed.'),
            ]);

            return;
        }

        $billing = $order->getBilling();
        $shipping = $order->getShipping();

        // Check if the shipping and billing model already exist. If not create a new instance.         if (!$shipping instanceof Shipping) {
            $shipping = new Shipping();
        }

        if (!$billing instanceof Billing) {
            $billing = new Billing();
        }
        // Get all passed order data         $data = $this->Request()->getParams();

        
$order = $this->container->get(ModelManager::class)->find(Order::class$orderId);
        if (!$order instanceof Order) {
            throw new ModelNotFoundException(Order::class$orderId);
        }

        $customer = $order->getCustomer();
        if (!$customer instanceof Customer) {
            throw new ModelNotFoundException(Customer::class$orderId);
        }

        $orderShippingAddress = $order->getShipping();
        if (!$orderShippingAddress instanceof Shipping) {
            throw new ModelNotFoundException(Shipping::class$orderId);
        }

        $shop = $order->getShop();
        if (!$shop instanceof Shop) {
            throw new ModelNotFoundException(Shop::class$orderId);
        }

        $customerGroup = $customer->getGroup() ?? $this->container->get(ModelManager::class)->getRepository(Group::class)->findOneBy(['key' => self::DEFAULT_CUSTOMER_GROUP]);
        if (!$customerGroup instanceof Group) {
            
Home | Imprint | This part of the site doesn't use cookies.