Public Member Functions | |
__construct ($attributes=array()) | |
getGridUrl () | |
getGridParentHtml () | |
getRowUrl ($row) | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () |
Definition at line 35 of file Cart.php.
__construct | ( | $ | attributes = array() |
) |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 38 of file Cart.php.
00039 { 00040 parent::__construct($attributes); 00041 $this->setId('customer_cart_grid'.$this->getWebsiteId()); 00042 $this->setUseAjax(true); 00043 $this->_parentTemplate = $this->getTemplate(); 00044 $this->setTemplate('customer/tab/cart.phtml'); 00045 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 47 of file Cart.php.
00048 { 00049 $customer = Mage::registry('current_customer'); 00050 $storeIds = Mage::app()->getWebsite($this->getWebsiteId())->getStoreIds(); 00051 00052 $quote = Mage::getModel('sales/quote') 00053 ->setSharedStoreIds($storeIds) 00054 ->loadByCustomer($customer); 00055 00056 if ($quote) { 00057 $collection = $quote->getItemsCollection(false); 00058 } 00059 else { 00060 $collection = new Varien_Data_Collection(); 00061 } 00062 00063 $collection->addFieldToFilter('parent_item_id', array('null' => true)); 00064 00065 $this->setCollection($collection); 00066 00067 return parent::_prepareCollection(); 00068 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 70 of file Cart.php.
00071 { 00072 $this->addColumn('product_id', array( 00073 'header' => Mage::helper('customer')->__('Product ID'), 00074 'index' => 'product_id', 00075 'width' => '100px', 00076 )); 00077 00078 $this->addColumn('name', array( 00079 'header' => Mage::helper('customer')->__('Product Name'), 00080 'index' => 'name', 00081 )); 00082 00083 $this->addColumn('sku', array( 00084 'header' => Mage::helper('customer')->__('SKU'), 00085 'index' => 'sku', 00086 'width' => '100px', 00087 )); 00088 00089 $this->addColumn('qty', array( 00090 'header' => Mage::helper('customer')->__('Qty'), 00091 'index' => 'qty', 00092 'type' => 'number', 00093 'width' => '60px', 00094 )); 00095 00096 $this->addColumn('price', array( 00097 'header' => Mage::helper('customer')->__('Price'), 00098 'index' => 'price', 00099 'type' => 'currency', 00100 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE), 00101 )); 00102 00103 $this->addColumn('total', array( 00104 'header' => Mage::helper('customer')->__('Total'), 00105 'index' => 'row_total', 00106 'type' => 'currency', 00107 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE), 00108 )); 00109 00110 $this->addColumn('action', array( 00111 'header' => Mage::helper('customer')->__('Action'), 00112 'index' => 'quote_item_id', 00113 'type' => 'action', 00114 'filter' => false, 00115 'sortable' => false, 00116 'actions' => array( 00117 array( 00118 'caption' => Mage::helper('customer')->__('Delete'), 00119 'url' => '#', 00120 'onclick' => 'return ' . $this->getJsObjectName() . 'cartControl.removeItem($item_id);' 00121 ) 00122 ) 00123 )); 00124 00125 return parent::_prepareColumns(); 00126 }
getGridParentHtml | ( | ) |
Definition at line 133 of file Cart.php.
00134 { 00135 $templateName = Mage::getDesign()->getTemplateFilename($this->_parentTemplate, array('_relative'=>true)); 00136 return $this->fetchView($templateName); 00137 }
getGridUrl | ( | ) |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 128 of file Cart.php.
00129 { 00130 return $this->getUrl('*/*/cart', array('_current'=>true, 'website_id' => $this->getWebsiteId())); 00131 }
getRowUrl | ( | $ | row | ) |