I am trying to create a simple bulleted list of items that have already been added to the cart, which will later be passed through a gravity form field. Here is what I have come up with so far:
<?php global $woocommerce;
$items = $woocommerce->cart->get_cart();
foreach($items as $item => $product_id) { ?>
<li><?php echo $item; ?></li>
<?php } ?>
I have 2 items added to the cart, and get a result of:
- 747579165776fe1ba349237464ae0eed
- f06a642b52d91adfa0168b737bd60db9
However, I am trying to grab the title of the products rather than the key.