12May2016 Get woocommerce cart count in WordPress categories: PHP, Wordpress For our customization want to get the count of number of products in a cart then use the following code. global $woocommerce; $count = $woocommerce->cart->cart_contents_count; if ($count > 0) { echo $count; } else { echo "No products in cart"; } Have any doubt, then comment here! Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Email * Website
For our customization want to get the count of number of products in a cart then use the following code. global $woocommerce; $count = $woocommerce->cart->cart_contents_count; if ($count > 0) { echo $count; } else { echo "No products in cart"; } Have any doubt, then comment here! Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Email * Website