Public Member Functions | |
createIndexData (Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute=null) | |
Protected Member Functions | |
_construct () | |
_isAttributeIndexable (Mage_Eav_Model_Entity_Attribute_Abstract $attribute) | |
_getIndexableAttributeConditions () | |
Protected Attributes | |
$_processChildren = false |
Definition at line 33 of file Tierprice.php.
_construct | ( | ) | [protected] |
Enter description here...
Reimplemented from Varien_Object.
Definition at line 37 of file Tierprice.php.
00038 { 00039 $this->_init('catalogindex/indexer_price'); 00040 $this->_currencyModel = Mage::getModel('directory/currency'); 00041 $this->_customerGroups = Mage::getModel('customer/group')->getCollection(); 00042 00043 return parent::_construct(); 00044 }
_getIndexableAttributeConditions | ( | ) | [protected] |
Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.
Definition at line 92 of file Tierprice.php.
00093 { 00094 $conditions = array(); 00095 $conditions['attribute_code'] = 'tier_price'; 00096 00097 return $conditions; 00098 }
_isAttributeIndexable | ( | Mage_Eav_Model_Entity_Attribute_Abstract $ | attribute | ) | [protected] |
Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.
Definition at line 83 of file Tierprice.php.
00084 { 00085 if ($attribute->getAttributeCode() != 'tier_price') { 00086 return false; 00087 } 00088 00089 return true; 00090 }
createIndexData | ( | Mage_Catalog_Model_Product $ | object, | |
Mage_Eav_Model_Entity_Attribute_Abstract $ | attribute = null | |||
) |
Implements Mage_CatalogIndex_Model_Indexer_Interface.
Definition at line 46 of file Tierprice.php.
00047 { 00048 $data = array(); 00049 00050 $data['store_id'] = $attribute->getStoreId(); 00051 $data['entity_id'] = $object->getId(); 00052 $data['attribute_id'] = $attribute->getId(); 00053 00054 $result = array(); 00055 $values = $object->getData($attribute->getAttributeCode()); 00056 00057 if (!is_array($values)) { 00058 return $result; 00059 } 00060 00061 foreach ($values as $row) { 00062 if (isset($row['delete']) && $row['delete']) { 00063 continue; 00064 } 00065 00066 $data['qty'] = $row['price_qty']; 00067 $data['value'] = $row['price']; 00068 if ($row['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL) { 00069 foreach ($this->_customerGroups as $group) { 00070 $data['customer_group_id'] = $group->getId(); 00071 $result[] = $data; 00072 } 00073 } else { 00074 $data['customer_group_id'] = $row['cust_group']; 00075 $result[] = $data; 00076 } 00077 00078 } 00079 00080 return $result; 00081 }
$_processChildren = false [protected] |
Reimplemented from Mage_CatalogIndex_Model_Indexer_Abstract.
Definition at line 35 of file Tierprice.php.