00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 class Mage_Adminhtml_Block_Customer_Edit_Tab_View_Accordion extends Mage_Adminhtml_Block_Widget_Accordion
00035 {
00036 protected function _prepareLayout()
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
00049 foreach (Mage::registry('current_customer')->getSharedWebsiteIds() as $websiteId) {
00050 $website = Mage::app()->getWebsite($websiteId);
00051
00052
00053 $cartItemsCount = Mage::getModel('sales/quote')
00054 ->setWebsite($website)->loadByCustomer($customer)
00055 ->getItemsCollection(false)->getSize();
00056
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
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
00073 $wishlistCount = Mage::getModel('wishlist/wishlist')->loadByCustomer($customer)
00074 ->getProductCollection()
00075 ->addStoreData()
00076 ->getSize();
00077
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 }
00084 }