/** * 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(); }
/** * 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(); }
public function testGetBmlPublisherId() { $this->_scopeConfig->expects($this->once())->method('getValue')->with('payment/' . Config::METHOD_WPP_BML . '/publisher_id')->will($this->returnValue('12345')); $this->assertEquals('12345', $this->_model->getBmlPublisherId()); }