get cart items programmatically in WordPress woo-commerce

Add the following code in your php code file: get cart items programmatically in WordPress woo-commerceexpoundsofttechsolution get cart items programmatically in WordPress woo-commerce
<?php
    global $woocommerce;
    $cart_items = $woocommerce->cart->get_cart();

        foreach($cart_items as $item => $values) {
            $_product =  wc_get_product( $values['data']->get_id());
            echo "<b>".$_product->get_title().'</b>  <br> Quantity: '.$values['quantity'].'<br>';
            $price = get_post_meta($values['product_id'] , '_price', true);
            echo "  Price: ".$price."<br>";
        }
?>