For one of my projects I needed the original cart total price without the Cartflows product discounts. I created the following function to achieve this:
/**
* Returns total cart price without discounts
*/
function get_cartflows_original_cart_total() {
return array_reduce( WC()->cart->get_cart(), function( $total, $item ) {
if ( empty( $item['data'] ) ) return $total;
$product = $item['data'];
$regular_price = $product->get_regular_price();
$item_total = $regular_price * $item['quantity'];
$total += $item_total;
return $total;
});
}