Example #1
0
 public function render(Varien_Object $row)
 {
     $html = '';
     if (in_array($row->getCustomerGroupId(), explode(',', Mage::getStoreConfig('reminder/generalsettings/groupsonaccount')))) {
         $html .= Mage::helper('reminder')->__('On account');
     } else {
         $html .= Mage::helper('reminder')->__('Prepaid');
     }
     return $html;
 }
 /**
  * Keep customer cookies synchronized with customer session
  *
  * @return Enterprise_PageCache_Model_Cookie
  */
 public function updateCustomerCookies()
 {
     /** @var Mage_Customer_Model_Session $session */
     $session = Mage::getSingleton('customer/session');
     $customerId = $session->getCustomerId();
     $customerGroupId = $session->getCustomerGroupId();
     if (!$customerId || is_null($customerGroupId)) {
         $customerCookies = new Varien_Object();
         Mage::dispatchEvent('update_customer_cookies', array('customer_cookies' => $customerCookies));
         if (!$customerId) {
             $customerId = $customerCookies->getCustomerId();
         }
         if (is_null($customerGroupId)) {
             $customerGroupId = $customerCookies->getCustomerGroupId();
         }
     }
     if ($customerId && !is_null($customerGroupId)) {
         $this->setObscure(self::COOKIE_CUSTOMER, 'customer_' . $customerId);
         $this->setObscure(self::COOKIE_CUSTOMER_GROUP, 'customer_group_' . $customerGroupId);
         if ($session->isLoggedIn()) {
             $this->setObscure(self::COOKIE_CUSTOMER_LOGGED_IN, 'customer_logged_in_' . $session->isLoggedIn());
         } else {
             $this->delete(self::COOKIE_CUSTOMER_LOGGED_IN);
         }
     } else {
         $this->delete(self::COOKIE_CUSTOMER);
         $this->delete(self::COOKIE_CUSTOMER_GROUP);
         $this->delete(self::COOKIE_CUSTOMER_LOGGED_IN);
     }
     return $this;
 }
Example #3
0
 public function validate(Varien_Object $quote)
 {
     $storesIds = $this->getStores();
     $arrStores = explode(',', $storesIds);
     $storesValidation = empty($storesIds) || in_array($quote->getStoreId(), $arrStores);
     $customerGroupsIds = $this->getCustGroups();
     $arrCustomerGroups = explode(',', $customerGroupsIds);
     $customerGroupValidation = empty($customerGroupsIds) || in_array($quote->getCustomerGroupId(), $arrCustomerGroups);
     return $storesValidation && $customerGroupValidation && $this->_validateAddress($quote);
 }