Protected Member Functions | |
_prepareLayout () |
Definition at line 34 of file Accordion.php.
_prepareLayout | ( | ) | [protected] |
Preparing global layout
You can redefine this method in child classes for changin layout
Reimplemented from Mage_Core_Block_Abstract.
Definition at line 36 of file Accordion.php.
00037 { 00038 $customer = Mage::registry('current_customer'); 00039 00040 $this->setId('customerViewAccordion'); 00041 00042 $this->addItem('lastOrders', array( 00043 'title' => Mage::helper('customer')->__('Recent Orders'), 00044 'ajax' => true, 00045 'content_url' => $this->getUrl('*/*/lastOrders', array('_current' => true)), 00046 )); 00047 00048 // add shopping cart block of each website 00049 foreach (Mage::registry('current_customer')->getSharedWebsiteIds() as $websiteId) { 00050 $website = Mage::app()->getWebsite($websiteId); 00051 00052 // count cart items 00053 $cartItemsCount = Mage::getModel('sales/quote') 00054 ->setWebsite($website)->loadByCustomer($customer) 00055 ->getItemsCollection(false)->getSize(); 00056 // prepare title for cart 00057 $title = Mage::helper('customer')->__('Shopping Cart - %d item(s)', $cartItemsCount); 00058 if (count($customer->getSharedWebsiteIds()) > 1) { 00059 $title = Mage::helper('customer')->__('Shopping Cart of %1$s - %2$d item(s)', 00060 $website->getName(), $cartItemsCount 00061 ); 00062 } 00063 00064 // add cart ajax accordion 00065 $this->addItem('shopingCart' . $websiteId, array( 00066 'title' => $title, 00067 'ajax' => true, 00068 'content_url' => $this->getUrl('*/*/viewCart', array('_current' => true, 'website_id' => $websiteId)), 00069 )); 00070 } 00071 00072 // count wishlist items 00073 $wishlistCount = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer) 00074 ->getProductCollection() 00075 ->addStoreData() 00076 ->getSize(); 00077 // add wishlist ajax accordion 00078 $this->addItem('wishlist', array( 00079 'title' => Mage::helper('customer')->__('Wishlist - %d item(s)', $wishlistCount), 00080 'ajax' => true, 00081 'content_url' => $this->getUrl('*/*/viewWishlist', array('_current' => true)), 00082 )); 00083 }