12 use Magento\Quote\Model\ShippingAssignmentFactory;
23 private $shippingAssignmentFactory;
38 private $addressRepository;
47 ShippingAssignmentFactory $shippingAssignmentFactory,
52 $this->shippingAssignmentFactory = $shippingAssignmentFactory;
55 $this->addressRepository = $addressRepository
71 $shippingAssignment = $this->shippingAssignmentFactory->create();
72 $shippingAssignment->setItems(
$quote->getItems());
73 $shippingAssignment->setShipping($this->shippingProcessor->create(
$shippingAddress));
75 return $shippingAssignment;
100 $this->addressRepository->getById(
$shippingAddress->getCustomerAddressId());
101 }
catch (NoSuchEntityException $e) {
__construct(ShippingAssignmentFactory $shippingAssignmentFactory, ShippingProcessor $shippingProcessor, CartItemPersister $cartItemPersister, AddressRepositoryInterface $addressRepository=null)