I am trying to send the woocommerce cart items to third party shipping tool. I need the item name, quantity and individual price to be sent to the third party. How can this be achieved?
$items = $woocommerce->cart->get_cart();
foreach($items as $item => $values) {
$_product = $values['data']->post;
echo $_product->post_title;
}
How do I get item name and quantity and price?
Try this :
To get Product Image and Regular & Sale Price:
you can get the product name like this
Since WooCommerce 2.1 (2014) you should use the WC function instead of the global. You can also call more appropriate functions:
This will not only be clean code, but it will be better than accessing the post_meta directly because it will apply filters if necessary.
This will show only Cart Items Count.