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-weee
Observer
AfterAddressSave.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Weee\Observer
;
7
8
use
Magento\Customer\Model\Address
;
9
use
Magento\Framework\Event\Observer
;
10
use
Magento\Framework\Event\ObserverInterface
;
11
use
Magento\Framework\Module\Manager
;
12
use
Magento\PageCache\Model\Config
;
13
use
Magento\Tax\Api\TaxAddressManagerInterface
;
14
use
Magento\Weee\Helper\Data
;
15
16
class
AfterAddressSave
implements
ObserverInterface
17
{
21
protected
$weeeHelper
;
22
28
private
$moduleManager;
29
35
private
$cacheConfig;
36
42
private
$addressManager;
43
50
public
function
__construct
(
51
Data
$weeeHelper
,
52
Manager
$moduleManager,
53
Config
$cacheConfig,
54
TaxAddressManagerInterface
$addressManager
55
) {
56
$this->weeeHelper =
$weeeHelper
;
57
$this->moduleManager =
$moduleManager
;
58
$this->cacheConfig = $cacheConfig;
59
$this->addressManager = $addressManager;
60
}
61
67
public
function
execute
(
Observer
$observer
)
68
{
69
if
($this->moduleManager->isEnabled(
'Magento_PageCache'
)
70
&& $this->cacheConfig->isEnabled()
71
&& $this->weeeHelper->isEnabled()
72
) {
74
$address
=
$observer
->getCustomerAddress();
75
$this->addressManager->setDefaultAddressAfterSave(
$address
);
76
}
77
}
78
}
Magento\Weee\Observer\AfterAddressSave\$weeeHelper
$weeeHelper
Definition:
AfterAddressSave.php:21
Magento\Weee\Helper\Data
Definition:
Data.php:22
Magento\Weee\Observer\AfterAddressSave
Definition:
AfterAddressSave.php:16
Magento\Customer\Model\Address
Definition:
AbstractAddress.php:7
Magento\Tax\Api\TaxAddressManagerInterface
Definition:
TaxAddressManagerInterface.php:14
Magento\Customer\Model\Address\Config
Definition:
Config.php:16
Magento\Framework\Event\ObserverInterface
Definition:
ObserverInterface.php:16
Magento\Weee\Observer
Definition:
AddPaymentWeeeItem.php:6
$address
$address
Definition:
customer.php:38
$observer
$observer
Definition:
second_website_with_second_currency.php:38
Magento\PageCache\Model\Config
Definition:
Config.php:21
Magento\Framework\Event\Observer
Definition:
Collection.php:12
$moduleManager
$moduleManager
Definition:
products.php:75
Magento\Weee\Observer\AfterAddressSave\__construct
__construct(Data $weeeHelper, Manager $moduleManager, Config $cacheConfig, TaxAddressManagerInterface $addressManager)
Definition:
AfterAddressSave.php:50
Magento\Framework\Module\Manager
Definition:
Manager.php:20
Magento\Framework\Event\ObserverInterface\execute
execute(Observer $observer)
Magento\Framework\Event\Observer
Definition:
Observer.php:14