foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) { $_product = $values[‘data’]; $product_id = $_product->id; print_r($product_id.”, “); }
} ?>Look Products Already Added To Cart Woocommerce
Already added product to cart in Woocommerce. So you can get the product id, information by this code.
// header
<?php
global $woocommerce;
require_once(‘../../../wp-load.php’);
// cart loop in woocommerce
if ( sizeof( $woocommerce->cart->get_cart() ) > 0 ) {