Example #1
0
 /**
  * Retrieve label for scope
  *
  * @param \Magento\Backend\Model\Config\Structure\Element\Field $field
  * @return string
  */
 public function getScopeLabel(\Magento\Backend\Model\Config\Structure\Element\Field $field)
 {
     $showInStore = $field->showInStore();
     $showInWebsite = $field->showInWebsite();
     if ($showInStore == 1) {
         return $this->_scopeLabels[self::SCOPE_STORES];
     } elseif ($showInWebsite == 1) {
         return $this->_scopeLabels[self::SCOPE_WEBSITES];
     }
     return $this->_scopeLabels[self::SCOPE_DEFAULT];
 }
Example #2
0
 public function testShowInWebsite()
 {
     $this->assertFalse($this->_model->showInWebsite());
     $this->_model->setData(array('showInWebsite' => 1), 'scope');
     $this->assertTrue($this->_model->showInWebsite());
 }