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_Checkout_Block_Cart extends Mage_Checkout_Block_Cart_Abstract
00035 {
00036
00037 public function chooseTemplate()
00038 {
00039 if ($this->getQuote()->getItemsCount()) {
00040 $this->setTemplate($this->getCartTemplate());
00041 } else {
00042 $this->setTemplate($this->getEmptyTemplate());
00043 }
00044 }
00045
00046 public function hasError()
00047 {
00048 return $this->getQuote()->getHasError();
00049 }
00050
00051 public function getItemsSummaryQty()
00052 {
00053 return $this->getQuote()->getItemsSummaryQty();
00054 }
00055
00056 public function isWishlistActive()
00057 {
00058 $isActive = $this->_getData('is_wishlist_active');
00059 if ($isActive === null) {
00060 $isActive = Mage::getStoreConfig('wishlist/general/active') && Mage::getSingleton('customer/session')->isLoggedIn();
00061 $this->setIsWishlistActive($isActive);
00062 }
00063 return $isActive;
00064 }
00065
00066 public function getCheckoutUrl()
00067 {
00068 return $this->getUrl('checkout/onepage', array('_secure'=>true));
00069 }
00070
00071 public function getContinueShoppingUrl()
00072 {
00073 $url = $this->getData('continue_shopping_url');
00074 if (is_null($url)) {
00075 $url = Mage::getSingleton('checkout/session')->getContinueShoppingUrl(true);
00076 if (!$url) {
00077 $url = Mage::getUrl();
00078 }
00079 $this->setData('continue_shopping_url', $url);
00080 }
00081 return $url;
00082 }
00083
00084 public function getIsVirtual()
00085 {
00086 return $this->helper('checkout/cart')->getIsVirtualQuote();
00087 }
00088
00089 }