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.

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

Call from the template,

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.