예제 #1
0
파일: Banners.php 프로젝트: aiesh/magento2
 /**
  * Disable block output if banner turned off or PublisherId is miss
  *
  * @return string
  */
 protected function _toHtml()
 {
     $publisherId = $this->_paypalConfig->getBmlPublisherId();
     $display = $this->_paypalConfig->getBmlDisplay($this->_section);
     $position = $this->_paypalConfig->getBmlPosition($this->_section);
     if (!$publisherId || $display == 0 || $this->_position != $position) {
         return '';
     }
     $this->setData('publisher_id', $publisherId);
     $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section));
     return parent::_toHtml();
 }
예제 #2
0
 /**
  * Disable block output if banner turned off or PublisherId is miss
  *
  * @return string
  */
 protected function _toHtml()
 {
     if (!$this->_paypalConfig->isMethodAvailable(Config::METHOD_WPP_BML) && !$this->_paypalConfig->isMethodAvailable(Config::METHOD_WPP_PE_BML)) {
         return '';
     }
     $publisherId = $this->_paypalConfig->getBmlPublisherId();
     $display = $this->_paypalConfig->getBmlDisplay($this->_section);
     $position = $this->_paypalConfig->getBmlPosition($this->_section);
     if (!$publisherId || $display == 0 || $this->_position != $position) {
         return '';
     }
     $this->setData('publisher_id', $publisherId);
     $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section));
     return parent::_toHtml();
 }
예제 #3
0
 /**
  * @dataProvider getBmlSizeDataProvider
  */
 public function testGetBmlSize($section, $expected)
 {
     $this->_scopeConfig->expects($this->once())->method('getValue')->with('payment/' . Config::METHOD_WPP_BML . '/' . $section . '_size')->will($this->returnValue($expected));
     $this->assertEquals($expected, $this->_model->getBmlSize($section));
 }