Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CatalogProductSaveAfterObserver.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  protected $_quote;
16 
21  {
22  $this->_quote = $quote;
23  }
24 
32  protected function _recollectQuotes($productId, $status)
33  {
34  if ($status != \Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED) {
35  $this->_quote->markQuotesRecollect($productId);
36  }
37  }
38 
45  public function execute(\Magento\Framework\Event\Observer $observer)
46  {
47  $product = $observer->getEvent()->getProduct();
48  $this->_recollectQuotes($product->getId(), $product->getStatus());
49  }
50 }
$quote
$status
Definition: order_status.php:8