Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **File Paths:**
- namespace EwallCustomPriceObserver;
- use MagentoFrameworkEventObserverInterface;
- use MagentoFrameworkAppRequestInterface;
- class SalesQuoteSaveAfterCustom
- {
- protected $checkoutSession;
- public function __construct(MagentoCheckoutModelSession $checkoutSession)
- {
- $this->checkoutSession = $checkoutSession;
- }
- public function invoke($observer)
- {
- $writer = new ZendLogWriterStream(BP . '/var/log/test.log');
- $logger = new ZendLogLogger();
- $logger->addWriter($writer);
- $logger->info('invoke function is calling');
- $quote = $observer->getEvent()->getQuote();
- /* @var $quote MagentoQuoteModelQuote */
- if($quote->getIsCheckoutCart())
- {
- $this->checkoutSession->getQuoteId($quote->getId());
- }
- }
- }
- <?xml version="1.0"?>
- <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
- <event name="sales_quote_save_after">
- <observer name="Ewall_CustomPrice_Custom" instance="EwallCustomPriceObserverSalesQuoteSaveAfterCustom" />
- </event>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement