How to check redirect to cart enable programmatically Magento 2?

After adding product to cart, you can directly Redirect to the Cart page, Using OOB Magento 2 settings.

Manually Settings:

If you have enabled this feature from the Stores -> Configuration -> Sales -> Checkout -> Shopping Cart -> After Adding a Product Redirect to Shopping Cart, It will redirect to cart after adding product.

By Default Setting is Disabled(No), Once you add a product from the Category or Product page, It will stay on the same page without redirect to the cart page.

<?php
namespace Jesadiya\RedirectToCart\Block;

use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Magento\Framework\App\Config\ScopeConfigInterface;

class IsRedirectToCart extends Template
{
    /**
     * @var ScopeConfigInterface
     */
    protected $scopeConfig;

    public function __construct(
        Context $context,
    ) {
        $this->scopeConfig = $scopeConfig;
        parent::__construct($context, $data);
    }

    /**
     * Whether redirect to cart enabled
     *
     * @return bool
     */
    public function isRedirectToCartEnabled()
    {
        return $this->scopeConfig->getValue(
            'checkout/cart/redirect_to_cart',
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE
        );
    }
}

XML path for the Redirect to cart is, “checkout/cart/redirect_to_cart”

Call from the template,

$isRedirectEnable = $block->isRedirectToCartEnabled();

From the given code snippet, You can check the status value of the redirect to the cart page. If the result will be true, redirect to cart enable otherwise it will be disabled.

Use the given code snippet in case if you need to check the setting enable or not for development time.