<?php

namespace Autogedal\AutogedalHelper\Block;

use Magento\Framework\View\Element\Template;

class ProductShipping extends Template
{
    protected $registry;
    protected $scopeConfig;
    public function __construct(Template\Context $context, 
        \Magento\Framework\Registry $registry,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        array $data = []
    )
    {
        $this->registry = $registry;
        $this->scopeConfig = $scopeConfig;
        parent::__construct($context, $data);
    }

    public function isFreeShipping()
    {
        $product = $this->registry->registry('current_product');
        $freeShippingStep = $this->scopeConfig->getValue('carriers/freeshipping/free_shipping_subtotal');
        return $product->getPrice() >= $freeShippingStep;
    }
}
