Public Member Functions | |
__construct () | |
getHeaderText () | |
getItemCollection () | |
canRemoveItems () | |
getIdentifierId ($item) | |
getProductId ($item) |
Definition at line 35 of file Pcompared.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 37 of file Pcompared.php.
00038 { 00039 parent::__construct(); 00040 $this->setId('sales_order_create_sidebar_pcompared'); 00041 $this->setDataId('pcompared'); 00042 }
canRemoveItems | ( | ) |
Retrieve availability removing items in block
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 93 of file Pcompared.php.
getHeaderText | ( | ) |
Definition at line 44 of file Pcompared.php.
00045 { 00046 return Mage::helper('sales')->__('Recently Compared Products'); 00047 }
getIdentifierId | ( | $ | item | ) |
Get product Id
Mage_Catalog_Model_Product | $item |
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 104 of file Pcompared.php.
getItemCollection | ( | ) |
Retrieve item collection
Reimplemented from Mage_Adminhtml_Block_Sales_Order_Create_Sidebar_Abstract.
Definition at line 54 of file Pcompared.php.
00055 { 00056 $productCollection = $this->getData('item_collection'); 00057 if (is_null($productCollection)) { 00058 // get products to skip 00059 $skipProducts = array(); 00060 if ($collection = $this->getCreateOrderModel()->getCustomerCompareList()) { 00061 $collection = $collection->getItemCollection() 00062 ->useProductItem(true) 00063 ->setStoreId($this->getStoreId()) 00064 ->setCustomerId($this->getCustomerId()) 00065 ->load(); 00066 foreach ($collection as $_item) { 00067 $skipProducts[] = $_item->getProductId(); 00068 } 00069 } 00070 00071 // prepare products collection and apply visitors log to it 00072 $productCollection = Mage::getModel('catalog/product')->getCollection() 00073 ->setStoreId($this->getQuote()->getStoreId()) 00074 ->addStoreFilter($this->getQuote()->getStoreId()) 00075 ->addAttributeToSelect('name') 00076 ->addAttributeToSelect('price') 00077 ->addAttributeToSelect('small_image'); 00078 Mage::getResourceSingleton('reports/event')->applyLogToCollection( 00079 $productCollection, Mage_Reports_Model_Event::EVENT_PRODUCT_COMPARE, $this->getCustomerId(), 0, $skipProducts 00080 ); 00081 00082 $productCollection->load(); 00083 $this->setData('item_collection', $productCollection); 00084 } 00085 return $productCollection; 00086 }
getProductId | ( | $ | item | ) |
Retrieve product identifier of block item
mixed | $item |
Definition at line 115 of file Pcompared.php.