Log in
Helper

Cart

Magento\Checkout\Helper\Cart

What it does

The Cart Helper provides utility methods for common shopping cart operations in Magento 2.

Developers use this class to generate cart-related URLs (add to cart, remove item, cart page), retrieve cart information (item count, quantities, quote data), and check cart configuration settings like whether to redirect customers to the cart after adding products.

Public Methods

  • getCart()
  • getAddUrl()
  • getRemoveUrl()
  • getDeletePostJson()
  • getCartUrl()
  • getQuote()
  • getItemsCount()
  • getItemsQty()
  • getSummaryCount()
  • getIsVirtualQuote()
  • getShouldRedirectToCart()