- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2020
11:20 PM
11-01-2020
11:20 PM
Re: Magento 1.9.2.3 - How to include Guest customer in Observer?
Use this code:
<?php class Gta_FilterPaymentGateway_Model_Observer { public function paymenter(Varien_Event_Observer $observer) { if($observer->getMethodInstance()->getCode() == 'paytm_cc'){ if(!Mage::getSingleton('customer/session')->isLoggedIn()){ $result = $observer->getResult(); $result->isAvailable = false; }else{ $currentCustomerGroup = (int)Mage::getSingleton('customer/session')->getCustomerGroupId(); if($currentCustomerGroup != 9){ $result = $observer->getResult(); $result->isAvailable = false; } } } } }
Problem solved? Click Kudos and "Accept as Solution".
200+ Magento 2 Extensions for Enhanced Shopping Experience.
200+ Magento 2 Extensions for Enhanced Shopping Experience.
- « Previous
-
- 1
- 2
- Next »