I have a question, for Woocommerce there is a hook or action that allows me to obtain the list that is stored in the shopping cart. Thank you so much. Thank you very much in advance
I have a question, for Woocommerce there is a hook or action that allows me to obtain the list that is stored in the shopping cart. Thank you so much. Thank you very much in advance
With this code you can get the shopping cart list
<?php
global $woocommerce;
$items = $woocommerce->cart->get_cart();
foreach($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>";
}
?>