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)
vendor
magento
module-inventory-shipping-admin-ui
Plugin
Sales
Block
Shipment
BackButtonUrlOnNewShipmentPagePlugin.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryShippingAdminUi\Plugin\Sales\Block\Shipment
;
9
10
use
Magento\Shipping\Block\Adminhtml\Create
;
11
use
Magento\InventoryShippingAdminUi\Model\IsWebsiteInMultiSourceMode
;
12
13
class
BackButtonUrlOnNewShipmentPagePlugin
14
{
18
private
$isWebsiteInMultiSourceMode;
19
23
public
function
__construct
(
24
IsWebsiteInMultiSourceMode
$isWebsiteInMultiSourceMode
25
) {
26
$this->isWebsiteInMultiSourceMode = $isWebsiteInMultiSourceMode;
27
}
28
34
public
function
afterGetBackUrl
(
Create
$subject,
$result
)
35
{
36
if
(empty($subject->
getShipment
())) {
37
return
$result
;
38
}
39
40
$websiteId
= (int)$subject->
getShipment
()->getOrder()->getStore()->getWebsiteId();
41
if
($this->isWebsiteInMultiSourceMode->execute(
$websiteId
)) {
42
return
$subject->
getUrl
(
43
'inventoryshipping/SourceSelection/index'
,
44
[
45
'order_id'
=> $subject->
getShipment
() ? $subject->
getShipment
()->getOrderId() : null
46
]
47
);
48
}
49
50
return
$result
;
51
}
52
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\InventoryShippingAdminUi\Plugin\Sales\Block\Shipment\BackButtonUrlOnNewShipmentPagePlugin\afterGetBackUrl
afterGetBackUrl(Create $subject, $result)
Definition:
BackButtonUrlOnNewShipmentPagePlugin.php:34
Magento\InventoryShippingAdminUi\Plugin\Sales\Block\Shipment\BackButtonUrlOnNewShipmentPagePlugin\__construct
__construct(IsWebsiteInMultiSourceMode $isWebsiteInMultiSourceMode)
Definition:
BackButtonUrlOnNewShipmentPagePlugin.php:23
Magento\InventoryShippingAdminUi\Model\IsWebsiteInMultiSourceMode
Definition:
IsWebsiteInMultiSourceMode.php:15
Magento\Shipping\Block\Adminhtml\Create
Definition:
Create.php:14
Magento\Shipping\Block\Adminhtml\Create
Definition:
Form.php:6
Magento\Framework\View\Element\AbstractBlock\getUrl
getUrl($route='', $params=[])
Definition:
AbstractBlock.php:773
Magento\InventoryShippingAdminUi\Plugin\Sales\Block\Shipment
Definition:
BackButtonUrlOnNewShipmentPagePlugin.php:8
Magento\InventoryShippingAdminUi\Plugin\Sales\Block\Shipment\BackButtonUrlOnNewShipmentPagePlugin
Definition:
BackButtonUrlOnNewShipmentPagePlugin.php:13
$websiteId
$websiteId
Definition:
products_with_websites_and_stores.php:11
Magento\Shipping\Block\Adminhtml\Create\getShipment
getShipment()
Definition:
Create.php:56