Website Building » WooCommerce » How Do I Get a Cart Item Price in WooCommerce?

How Do I Get a Cart Item Price in WooCommerce?

Last updated on October 1, 2022 @ 5:29 am

If you’re looking to get a cart item price in WooCommerce, there are a few different ways you can do it. First, you can use the built-in WooCommerce function wc_price(). This function will return the price of an item including any applicable taxes and fees.

Another way to get the cart item price is by using the WC_Cart::get_item_price() method. This method will return the raw price of an item before any taxes or fees are applied.

Finally, if you need to get the cart item price including any discounts that have been applied, you can use the WC_Cart::get_discounted_price() method.

Whichever method you choose, getting the cart item price in WooCommerce is easy and straightforward.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.