Example #1
0
 /**
  * @magentoDataFixture Mage/Catalog/_files/product_with_image.php
  */
 public function testImage()
 {
     $product = new Mage_Catalog_Model_Product();
     $product->load(1);
     $size = $this->_block->getImageSize();
     $this->assertGreaterThan(1, $size);
     $this->assertContains('/' . $size, $this->_block->getImageUrl($product));
     $this->assertStringEndsWith('magento_image.jpg', $this->_block->getImageUrl($product));
 }
Example #2
0
 /**
  * Retrieve block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->isEnabled()) {
         return parent::_toHtml();
     }
     return '';
 }
 /**
  * Build block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (Mage::helper('enterprise_wishlist')->isMultipleEnabled() && $this->isWishlistDeleteable()) {
         return parent::_toHtml();
     }
     return '';
 }
Example #4
0
 /**
  * Prepare before to html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->getItemCount()) {
         return parent::_toHtml();
     }
     return '';
 }
 /**
  * Prepare before to html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->_getHelper()->hasItems()) {
         return parent::_toHtml();
     }
     return '';
 }
Example #6
0
 /**
  * Check whether whishlist item has description
  *
  * @param Mage_Wishlist_Model_Item $item
  * @return bool
  */
 public function hasDescription($item)
 {
     $hasDescription = parent::hasDescription($item);
     if ($hasDescription) {
         return $item->getDescription() !== Mage::helper('wishlist')->defaultCommentString();
     }
     return $hasDescription;
 }
Example #7
0
 /**
  * Preparing global layout
  *
  * @return Mage_Wishlist_Block_Customer_Wishlist
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $headBlock->setTitle($this->__('My Wishlist'));
     }
 }
Example #8
0
 /**
  * Retrieve Wishlist model
  *
  * @return Mage_Wishlist_Model_Wishlist
  */
 protected function _getWishlist()
 {
     if (!$this->getCustomWishlist() || !is_null($this->_wishlist)) {
         return parent::_getWishlist();
     }
     $this->_wishlist = $this->getCustomWishlist();
     return $this->_wishlist;
 }
Example #9
0
 /**
  * Prepare global layout
  *
  * @return Mage_Wishlist_Block_Share_Wishlist
  *
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $headBlock->setTitle($this->getHeader());
     }
     return $this;
 }
Example #10
0
 /**
  * Retrieve block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->isEnabled()) {
         if (!$this->getLayout()) {
             return '';
         }
         foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $child) {
             if ($child) {
                 $child->setItem($this->getItem());
             }
         }
         return parent::_toHtml();
     }
     return '';
 }
Example #11
0
 /**
  * Retrieve Product View URL
  *
  * @param Mage_Catalog_Model_Product $product
  * @param array $additional
  * @return string
  */
 public function getProductUrl($product, $additional = array())
 {
     $additional['_rss'] = true;
     return parent::getProductUrl($product, $additional);
 }
Example #12
0
 /**
  * Retrieve URL for add product to shopping cart
  *
  * @param Mage_Catalog_Model_Product $product
  * @param array $additional
  * @return string
  */
 public function getAddToCartUrl($product, $additional = array())
 {
     $additional['nocookie'] = 1;
     $additional['_store_to_url'] = true;
     return parent::getAddToCartUrl($product, $additional);
 }
 /**
  * Retrieve cache tags
  *
  * @return array
  */
 public function getCacheTags()
 {
     if ($this->getItemCount()) {
         $this->addModelTags($this->_getHelper()->getWishlist());
     }
     return parent::getCacheTags();
 }
Example #14
0
 /**
  * Render block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setOptionList($this->getConfiguredOptions());
     return parent::_toHtml();
 }
Example #15
0
 /**
  * Render block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     $cfg = $this->getOptionsRenderCfg($this->getItem()->getProduct()->getTypeId());
     if (!$cfg) {
         return '';
     }
     $helper = Mage::helper($cfg['helper']);
     if (!$helper instanceof Mage_Catalog_Helper_Product_Configuration_Interface) {
         Mage::throwException($this->__("Helper for wishlist options rendering doesn't implement required interface."));
     }
     if ($cfg['template']) {
         $template = $cfg['template'];
     } else {
         $cfgDefault = $this->getOptionsRenderCfg('default');
         if (!$cfgDefault) {
             return '';
         }
         $template = $cfgDefault['template'];
     }
     $this->setTemplate($template)->setOptionList($helper->getOptions($this->getItem()));
     return parent::_toHtml();
 }