<?php

namespace Solwin\ScrolltoTop\Block;

use Magento\Framework\View\Element\Template;

class ScrolltoTop extends Template {

    protected $_config;
    
    public function __construct(
        \Magento\Catalog\Block\Product\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
    }

    //Get base url
    public function getBaseUrl() {
        return $this->_storeManager->getStore()->getBaseUrl();
    }
    
    /* get extension enable/disable  */
    public function getExtensionenable() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
    
    /* get display options  */
    public function getDisplayoptions() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/display', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
    
    /* get button position  */
    public function getPosition() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/position', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
    
    /* get button text  */
    public function getBtntext() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/link_text', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
    
    /* get button image  */
    public function getBtnimage() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/link_image', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
    
    /* get button text color  */
    public function getBtntextcolor() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/textclr', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
    
    /* get button background color  */
    public function getBtnbackgroundcolor() {
        return $this->_scopeConfig->getValue('scrollsection/scrollgroup/bgclr', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    }
}
