public function testShowInStore() { $this->assertFalse($this->_model->showInStore()); $this->_model->setData(['showInStore' => 1], 'scope'); $this->assertTrue($this->_model->showInStore()); }
/** * {@inheritdoc} */ public function showInStore() { $pluginInfo = $this->pluginList->getNext($this->subjectType, 'showInStore'); if (!$pluginInfo) { return parent::showInStore(); } else { return $this->___callPlugins('showInStore', func_get_args(), $pluginInfo); } }
/** * 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]; }
/** * Retrieve label for scope * * @param Field $field The field * * @return string */ public function getScopeLabel(Field $field) { $showInStore = $field->showInStore(); $showInContainer = $field->showInContainer(); if ($showInStore == 1) { return $this->_scopeLabels[ContainerScopeInterface::SCOPE_STORE_CONTAINERS]; } elseif ($showInContainer == 1) { return $this->_scopeLabels[ContainerScopeInterface::SCOPE_CONTAINERS]; } return $this->_scopeLabels[ContainerScopeInterface::SCOPE_DEFAULT]; }