/**
  * @magentoAppIsolation enabled
  * @magentoDataFixture Magento/Catalog/_files/product_with_image.php
  */
 public function testImage()
 {
     \Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND);
     \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\DesignInterface')->setDefaultDesignTheme();
     $product = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\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));
 }
예제 #2
0
 /**
  * Prepare before to html
  *
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->getItemCount()) {
         return parent::_toHtml();
     }
     return '';
 }
예제 #3
0
파일: Wishlist.php 프로젝트: aiesh/magento2
 /**
  * Preparing global layout
  *
  * @return void
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $headBlock->setTitle(__('My Wish List'));
     }
 }
예제 #4
0
 /**
  * Check whether wishlist item has description
  *
  * @param \Magento\Wishlist\Model\Item $item
  * @return bool
  */
 public function hasDescription($item)
 {
     $hasDescription = parent::hasDescription($item);
     if ($hasDescription) {
         return $item->getDescription() !== $this->_wishlistHelper->defaultCommentString();
     }
     return $hasDescription;
 }
예제 #5
0
파일: Wishlist.php 프로젝트: aiesh/magento2
 /**
  * Prepare global layout
  *
  * @return $this
  *
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $headBlock = $this->getLayout()->getBlock('head');
     if ($headBlock) {
         $headBlock->setTitle($this->getHeader());
     }
     return $this;
 }
예제 #6
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 '';
 }
예제 #7
0
파일: Options.php 프로젝트: aiesh/magento2
 /**
  * Render block html
  *
  * @return string
  */
 protected function _toHtml()
 {
     $this->setOptionList($this->getConfiguredOptions());
     return parent::_toHtml();
 }
예제 #8
0
 /**
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->currentCustomer->getCustomerId()) {
         return parent::_toHtml();
     } else {
         return '';
     }
 }
예제 #9
0
 /**
  * Retrieve Product View URL
  *
  * @param \Magento\Catalog\Model\Product $product
  * @param array $additional
  * @return string
  */
 public function getProductUrl($product, $additional = array())
 {
     $additional['_rss'] = true;
     return parent::getProductUrl($product, $additional);
 }
예제 #10
0
 /**
  * Prepare global layout
  *
  * @return $this
  *
  */
 protected function _prepareLayout()
 {
     parent::_prepareLayout();
     $this->pageConfig->getTitle()->set($this->getHeader());
     return $this;
 }