Fetching Cart Data

Get complete cart details

$cart = cart()->toArray();

Get cart attributes

$cartAttributes = cart()->data();

Get cart attrbutes with currency amount

$cartTotals = cart()->totals();

Get cart individual attributes

Cart has following attributes: subtotal, discount, discountPercentage, couponId, shippingCharges, netTotal, tax, total, roundOff, payable.

You can access then using a getter method. For example,

$subtotal = cart()->getSubtotal();

Get cart items

$cartItems = cart()->items();

Get cart items with currency amount

$cartItems = cart()->items($displayCurrency = true);

Discounts