Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DepersonalizePlugin.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
19 
23  protected $checkoutSession;
24 
30  public function __construct(
32  \Magento\Checkout\Model\Session $checkoutSession
33  ) {
34  $this->checkoutSession = $checkoutSession;
35  $this->depersonalizeChecker = $depersonalizeChecker;
36  }
37 
45  public function afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result)
46  {
47  if ($this->depersonalizeChecker->checkIfDepersonalize($subject)) {
48  $this->checkoutSession->clearStorage();
49  }
50  return $result;
51  }
52 }
afterGenerateXml(\Magento\Framework\View\LayoutInterface $subject, $result)
__construct(DepersonalizeChecker $depersonalizeChecker, \Magento\Checkout\Model\Session $checkoutSession)