Public Member Functions | |
__construct () | |
_beforeToHtml () | |
getWebsiteCount ($websiteId) | |
getRows () | |
getTotals () | |
getPriceFormatted ($price) | |
Protected Attributes | |
$_collection | |
$_groupedCollection | |
$_websiteCounts | |
$_currency |
Definition at line 34 of file Sales.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 54 of file Sales.php.
00055 { 00056 parent::__construct(); 00057 $this->setId('customer_view_sales_grid'); 00058 }
_beforeToHtml | ( | ) |
Before rendering html, but after trying to load cache
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 60 of file Sales.php.
00061 { 00062 $this->_currency = Mage::getModel('directory/currency') 00063 ->load(Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE)) 00064 ; 00065 00066 $this->_collection = Mage::getResourceModel('sales/sale_collection') 00067 ->setCustomerFilter(Mage::registry('current_customer')) 00068 ->load() 00069 ; 00070 00071 $this->_groupedCollection = array(); 00072 00073 foreach ($this->_collection as $sale) { 00074 if (!is_null($sale->getStoreId())) { 00075 $store = Mage::app()->getStore($sale->getStoreId()); 00076 $websiteId = $store->getWebsiteId(); 00077 $groupId = $store->getGroupId(); 00078 $storeId = $store->getId(); 00079 00080 $sale->setWebsiteId($store->getWebsiteId()); 00081 $sale->setWebsiteName($store->getWebsite()->getName()); 00082 $sale->setGroupId($store->getGroupId()); 00083 $sale->setGroupName($store->getGroup()->getName()); 00084 } 00085 else { 00086 $websiteId = 0; 00087 $groupId = 0; 00088 $storeId = 0; 00089 00090 $sale->setStoreName(Mage::helper('customer')->__('Deleted Stores')); 00091 } 00092 00093 $this->_groupedCollection[$websiteId][$groupId][$storeId] = $sale; 00094 $this->_websiteCounts[$websiteId] = isset($this->_websiteCounts[$websiteId]) ? $this->_websiteCounts[$websiteId] + 1 : 1; 00095 } 00096 00097 return parent::_beforeToHtml(); 00098 }
getPriceFormatted | ( | $ | price | ) |
getRows | ( | ) |
getTotals | ( | ) |
getWebsiteCount | ( | $ | websiteId | ) |