Guest User

Untitled

a guest
May 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. namespace vendormoduleObserver;
  3. use MagentoFrameworkEventObserverInterface;
  4.  
  5. class customeramount implements MagentoFrameworkEventObserverInterface
  6. {
  7. public function __construct(MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig )
  8. {
  9. $this->_scopeConfig = $scopeConfig;
  10. }
  11. public function execute(MagentoFrameworkEventObserver $observer)
  12. {
  13. $objectManager = MagentoFrameworkAppObjectManager::getInstance();
  14. $customerSession = $objectManager->create('MagentoCustomerModelSession');
  15.  
  16. if($customerSession->isLoggedIn())
  17. {
  18. $customer_id = $customerSession->getCustomer()->getId();
  19. $customerSession->setMemebrCustomAttr('abc');
  20.  
  21. }
  22. }
  23.  
  24. }
  25. ?>
Add Comment
Please, Sign In to add comment