0

I want to get the configValue of system.xml in this block

<?php 
namespace Module\Vendor\Block\Adminhtml\Menu\Field;

use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;

class AdditionalItem extends AbstractFieldArray
{
protected $_typeblockOptions;
protected $_cmsblockOptions;
/**
 * {@inheritdoc}
 */

protected function _prepareToRender()
{

    $this->addColumn(
        'fromprice',
        [
            'label' => __('From Price'),
            'size' => '200px',
            'class' => 'required-entry'
        ]
    );

    $this->addColumn(
        'toprice',
        [
            'label' => __('To Price'),
            'size' => '200px',
            'class' => 'required-entry'
        ]
    );

    $this->addColumn(
        'productcost',
        [
            'label' => __('Product Cost'),
            'size' => '200px',
            'class' => 'required-entry'
        ]
    );

    $this->_addAfter = false;
    $this->_addButtonLabel = __('Add');
}
}

I tried to insert a __construct to extend \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig and then call $this->scopeConfig->getValue('....'), but it goes wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.