Example #1
0
 /**
  * Fetches redemption catalog rules for this products
  *
  * @param TBT_Rewards_Model_Customer $customer
  * @return array
  */
 public function getCatalogRedemptionRules($customer)
 {
     $datetime = Mage::helper('rewards')->now();
     $wId = Mage::app()->getStore(true)->getWebsiteId();
     if ($customer) {
         $gId = $customer->getGroupId();
     } else {
         $gId = Mage_Customer_Model_Group::NOT_LOGGED_IN_ID;
     }
     $rule_array = $this->getApplicableCatalogRules($datetime, $wId, $gId);
     return $rule_array;
 }
Example #2
0
 /**
  * Returns true if customerId is within the customer groups listed
  * @param TBT_Rewards_Model_Customer $customer	: current customer id
  * @param array $groupIds                   	: customer group ids array
  * 
  * @return boolean                          
  */
 protected function isInGroup($customer, array $groupIds)
 {
     $group_id = $customer->getGroupId();
     return array_search($group_id, $groupIds) !== false;
 }