Exemplo n.º 1
0
 public function addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now = null)
 {
     if (method_exists('Mage', 'getEdition')) {
         // available from CE 1.7
         return parent::addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now);
     }
     $this->getSelect()->where('is_active=1');
     $this->getSelect()->where('find_in_set(?, website_ids)', (int) $websiteId);
     $this->getSelect()->where('find_in_set(?, customer_group_ids)', (int) $customerGroupId);
     if (is_null($now)) {
         $now = Mage::getModel('core/date')->date('Y-m-d');
     }
     $this->getSelect()->where('from_date is null or from_date<=?', $now);
     $this->getSelect()->where('to_date is null or to_date>=?', $now);
     return $this;
 }