Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, AddressRepositoryInterface $addressRepository, \Magento\Framework\Event\ManagerInterface $eventManager, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Session\Generic $session, \Magento\Quote\Model\Quote\AddressFactory $addressFactory, \Magento\Quote\Model\Quote\Address\ToOrder $quoteAddressToOrder, \Magento\Quote\Model\Quote\Address\ToOrderAddress $quoteAddressToOrderAddress, \Magento\Quote\Model\Quote\Payment\ToOrderPayment $quotePaymentToOrderPayment, \Magento\Quote\Model\Quote\Item\ToOrderItem $quoteItemToOrderItem, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Payment\Model\Method\SpecificationInterface $paymentSpecification, \Magento\Multishipping\Helper\Data $helper, OrderSender $orderSender, PriceCurrencyInterface $priceCurrency, \Magento\Quote\Api\CartRepositoryInterface $quoteRepository, \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder, \Magento\Framework\Api\FilterBuilder $filterBuilder, \Magento\Quote\Model\Quote\TotalsCollector $totalsCollector, array $data=[], \Magento\Quote\Api\Data\CartExtensionFactory $cartExtensionFactory=null, AllowedCountries $allowedCountryReader=null, Multishipping\PlaceOrderFactory $placeOrderFactory=null, LoggerInterface $logger=null, \Magento\Framework\Api\DataObjectHelper $dataObjectHelper=null) | |
getQuoteShippingAddressesItems () | |
removeAddressItem ($addressId, $itemId) | |
setShippingItemsInformation ($info) | |
updateQuoteCustomerShippingAddress ($addressId) | |
setQuoteCustomerBillingAddress ($addressId) | |
setPaymentMethod ($payment) | |
save () | |
reset () | |
validateMinimumAmount () | |
getMinimumAmountDescription () | |
getMinimumAmountError () | |
getOrderIds ($asAssoc=false) | |
getCustomerDefaultBillingAddress () | |
getCustomerDefaultShippingAddress () | |
getCheckoutSession () | |
getQuote () | |
getQuoteItems () | |
getCustomerSession () | |
getCustomer () | |
![]() | |
__construct (array $data=[]) | |
addData (array $arr) | |
setData ($key, $value=null) | |
unsetData ($key=null) | |
getData ($key='', $index=null) | |
getDataByPath ($path) | |
getDataByKey ($key) | |
setDataUsingMethod ($key, $args=[]) | |
getDataUsingMethod ($key, $args=null) | |
hasData ($key='') | |
toArray (array $keys=[]) | |
convertToArray (array $keys=[]) | |
toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
toJson (array $keys=[]) | |
convertToJson (array $keys=[]) | |
toString ($format='') | |
__call ($method, $args) | |
isEmpty () | |
serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
debug ($data=null, &$objects=[]) | |
offsetSet ($offset, $value) | |
offsetExists ($offset) | |
offsetUnset ($offset) | |
offsetGet ($offset) | |
Protected Member Functions | |
_init () | |
_addShippingItem ($quoteItemId, $data) | |
_prepareOrder (\Magento\Quote\Model\Quote\Address $address) | |
![]() | |
_getData ($key) | |
_underscore ($name) | |
Additional Inherited Members | |
![]() | |
static | $_underscoreCache = [] |
Multishipping checkout model
@api @SuppressWarnings(PHPMD.TooManyFields) @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 28 of file Multishipping.php.
\Magento\Checkout\Model\Session | $checkoutSession | |
\Magento\Customer\Model\Session | $customerSession | |
\Magento\Sales\Model\OrderFactory | $orderFactory | |
AddressRepositoryInterface | $addressRepository | |
\Magento\Framework\Event\ManagerInterface | $eventManager | |
\Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
\Magento\Framework\Session\Generic | $session | |
\Magento\Quote\Model\Quote\AddressFactory | $addressFactory | |
\Magento\Quote\Model\Quote\Address\ToOrder | $quoteAddressToOrder | |
\Magento\Quote\Model\Quote\Address\ToOrderAddress | $quoteAddressToOrderAddress | |
\Magento\Quote\Model\Quote\Payment\ToOrderPayment | $quotePaymentToOrderPayment | |
\Magento\Quote\Model\Quote\Item\ToOrderItem | $quoteItemToOrderItem | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Payment\Model\Method\SpecificationInterface | $paymentSpecification | |
\Magento\Multishipping\Helper\Data | $helper | |
OrderSender | $orderSender | |
PriceCurrencyInterface | $priceCurrency | |
\Magento\Quote\Api\CartRepositoryInterface | $quoteRepository | |
\Magento\Framework\Api\SearchCriteriaBuilder | $searchCriteriaBuilder | |
\Magento\Framework\Api\FilterBuilder | $filterBuilder | |
\Magento\Quote\Model\Quote\TotalsCollector | $totalsCollector | |
array | $data | |
\Magento\Quote\Api\Data\CartExtensionFactory | null | $cartExtensionFactory | |
AllowedCountries | null | $allowedCountryReader | |
Multishipping\PlaceOrderFactory | null | $placeOrderFactory | |
LoggerInterface | null | $logger | |
\Magento\Framework\Api\DataObjectHelper | null | $dataObjectHelper | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 208 of file Multishipping.php.
|
protected |
Add quote item to specific shipping address based on customer address id
int | $quoteItemId | |
array | $data | array('qty'=>$qty, 'address'=>$customerAddressId) |
Skip item processing if qty 0
Require shipping rate recollect
Definition at line 507 of file Multishipping.php.
|
protected |
Initialize multishipping checkout.
Split virtual/not virtual items between default billing/shipping addresses
reset quote shipping addresses and items
Remove all addresses
Items with parent id we add in importQuoteItem method. Skip virtual items
Definition at line 280 of file Multishipping.php.
|
protected |
Prepare order based on quote address
\Magento\Quote\Model\Quote\Address | $address |
Definition at line 675 of file Multishipping.php.
getCheckoutSession | ( | ) |
Retrieve checkout session model
Definition at line 1025 of file Multishipping.php.
getCustomer | ( | ) |
Retrieve customer object
Definition at line 1070 of file Multishipping.php.
getCustomerDefaultBillingAddress | ( | ) |
Retrieve customer default billing address
Definition at line 971 of file Multishipping.php.
getCustomerDefaultShippingAddress | ( | ) |
Retrieve customer default shipping address
Definition at line 982 of file Multishipping.php.
getCustomerSession | ( | ) |
Retrieve customer session model
Definition at line 1060 of file Multishipping.php.
getMinimumAmountDescription | ( | ) |
Get notification message for case when multishipping checkout is not allowed
Definition at line 916 of file Multishipping.php.
getMinimumAmountError | ( | ) |
getOrderIds | ( | $asAssoc = false | ) |
Get order IDs created during checkout
bool | $asAssoc |
Definition at line 957 of file Multishipping.php.
getQuote | ( | ) |
Retrieve quote model
Definition at line 1040 of file Multishipping.php.
getQuoteItems | ( | ) |
Retrieve quote items
Definition at line 1050 of file Multishipping.php.
getQuoteShippingAddressesItems | ( | ) |
Get quote items assigned to different quote addresses populated per item qty.
Based on result array we can display each item separately
Definition at line 345 of file Multishipping.php.
removeAddressItem | ( | $addressId, | |
$itemId | |||
) |
Remove item from address
int | $addressId | |
int | $itemId |
Require shipping rate recollect
Definition at line 361 of file Multishipping.php.
reset | ( | ) |
Specify BEGIN state in checkout session whot allow reinit multishipping checkout
Definition at line 889 of file Multishipping.php.
save | ( | ) |
Collect quote totals and save quote object
Definition at line 877 of file Multishipping.php.
setPaymentMethod | ( | $payment | ) |
Set payment method info to quote payment
array | $payment |
Definition at line 642 of file Multishipping.php.
setQuoteCustomerBillingAddress | ( | $addressId | ) |
Reimport customer billing address to quote
int | $addressId | customer address id |
Definition at line 588 of file Multishipping.php.
setShippingItemsInformation | ( | $info | ) |
Assign quote items to addresses and specify items qty
Array structure: array( $quoteItemId => array( 'qty' => $qty, 'address' => $customerAddressId ) )
array | $info |
Delete all not virtual quote items which are not added to shipping address MultishippingQty should be defined for each quote item when it processed with _addShippingItem
Definition at line 415 of file Multishipping.php.
updateQuoteCustomerShippingAddress | ( | $addressId | ) |
Reimport customer address info to quote shipping address
int | $addressId | customer address id |
Definition at line 561 of file Multishipping.php.
validateMinimumAmount | ( | ) |
Check if quote amount is allowed for multishipping checkout
Definition at line 900 of file Multishipping.php.
|
protected |
Definition at line 64 of file Multishipping.php.
|
protected |
Definition at line 81 of file Multishipping.php.
|
protected |
Definition at line 86 of file Multishipping.php.
|
protected |
Definition at line 42 of file Multishipping.php.
|
protected |
Definition at line 91 of file Multishipping.php.
|
protected |
Definition at line 35 of file Multishipping.php.
|
protected |
Definition at line 49 of file Multishipping.php.
|
protected |
Definition at line 54 of file Multishipping.php.
|
protected |
Definition at line 59 of file Multishipping.php.
|
protected |
Definition at line 96 of file Multishipping.php.
|
protected |
Definition at line 121 of file Multishipping.php.
|
protected |
Definition at line 76 of file Multishipping.php.
|
protected |
Definition at line 101 of file Multishipping.php.
|
protected |
Definition at line 69 of file Multishipping.php.
|
protected |
Definition at line 106 of file Multishipping.php.
|
protected |
Definition at line 126 of file Multishipping.php.
|
protected |
Definition at line 141 of file Multishipping.php.
|
protected |
Definition at line 131 of file Multishipping.php.
|
protected |
Definition at line 136 of file Multishipping.php.
|
protected |
Definition at line 111 of file Multishipping.php.
|
protected |
Definition at line 116 of file Multishipping.php.
|
protected |
Definition at line 146 of file Multishipping.php.