Exemplo n.º 1
0
 /**
  * Retrieve label for scope
  *
  * @param \Magento\Config\Model\Config\Structure\Element\Field $field
  * @return string
  */
 public function getScopeLabel(\Magento\Config\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];
 }
Exemplo n.º 2
0
 public function testShowInWebsite()
 {
     $this->assertFalse($this->_model->showInWebsite());
     $this->_model->setData(['showInWebsite' => 1], 'scope');
     $this->assertTrue($this->_model->showInWebsite());
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function showInWebsite()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'showInWebsite');
     if (!$pluginInfo) {
         return parent::showInWebsite();
     } else {
         return $this->___callPlugins('showInWebsite', func_get_args(), $pluginInfo);
     }
 }