Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
c
d
e
f
g
h
i
m
p
r
s
t
u
+
Functions
_
c
d
e
f
g
h
i
m
p
r
s
t
u
Variables
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
m
n
o
p
q
r
s
t
u
v
w
+
Functions
_
c
d
e
f
g
m
o
r
s
t
v
+
Variables
$
(
_
a
b
c
d
e
f
g
h
i
j
m
n
o
p
q
r
s
t
u
v
w
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Pages
vendor
magento
module-inventory-shipping-admin-ui
Model
ShipmentProvider.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryShippingAdminUi\Model
;
9
10
use
Magento\Shipping\Model\ShipmentProviderInterface
;
11
use
Magento\Framework\App\RequestInterface
;
12
13
class
ShipmentProvider
implements
ShipmentProviderInterface
14
{
18
private
$request;
19
23
public
function
__construct
(
24
RequestInterface
$request
25
) {
26
$this->request =
$request
;
27
}
28
32
public
function
getShipmentData
(): array
33
{
34
$sourceCode
= $this->request->getParam(
'sourceCode'
);
35
$items
= $this->request->getParam(
'items'
, []);
36
37
$shipmentItems = [];
38
foreach
(
$items
as
$item
) {
39
if
(empty(
$item
[
'sources'
])) {
40
continue
;
41
}
42
$orderItemId =
$item
[
'orderItemId'
];
43
foreach
(
$item
[
'sources'
] as
$source
) {
44
if
(
$source
[
'sourceCode'
] ==
$sourceCode
) {
45
$qty = ($shipmentItems[$orderItemId] ?? 0) + (
float
)
$source
[
'qtyToDeduct'
];
46
$shipmentItems[
'items'
][$orderItemId] = $qty;
47
}
48
}
49
}
50
51
return
count($shipmentItems) > 0 ? $shipmentItems : [];
52
}
53
}
Magento\InventoryShippingAdminUi\Model\ShipmentProvider\__construct
__construct(RequestInterface $request)
Definition:
ShipmentProvider.php:23
Magento\InventoryShippingAdminUi\Model\ShipmentProvider
Definition:
ShipmentProvider.php:13
$source
$source
Definition:
source.php:23
Magento\InventoryShippingAdminUi\Model\ShipmentProvider\getShipmentData
getShipmentData()
Definition:
ShipmentProvider.php:32
$item
$item
Definition:
partial_invoice.php:27
Magento\InventoryShippingAdminUi\Model
Definition:
IsWebsiteInMultiSourceMode.php:8
$sourceCode
$sourceCode
Definition:
inventory.phtml:11
Magento\Framework\App\RequestInterface
Definition:
RequestInterface.php:14
$request
$request
Definition:
quote_with_configurable_product_last_variation.php:22
Magento\Shipping\Model\ShipmentProviderInterface
Definition:
ShipmentProviderInterface.php:15
$items
$items
Definition:
order_rollback.php:21