/** * @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)); }
/** * 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 ''; }
/** * 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 ''; }
/** * 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; }
/** * 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')); } }
/** * 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; }
/** * 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; }
/** * 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 ''; }
/** * 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); }
/** * 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(); }
/** * Render block html * * @return string */ protected function _toHtml() { $this->setOptionList($this->getConfiguredOptions()); return parent::_toHtml(); }
/** * 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(); }