woocommerce_mini_cart()WC 1.0

Displays the mini-cart on the screen.

By default, the mini-cart template is defined in the file /woocommerce/templates/cart/mini-cart.php.

No Hooks.

Returns

null. Nothing.

Usage

woocommerce_mini_cart( $args );
$args(array)
Arguments that will be passed to the file mini-cart.php.
Default: array()

Examples

1

#1 Display the mini shopping cart and pass the css class

woocommerce_mini_cart( [ 'list_class' => 'my-css-class' ] );

woocommerce_mini_cart() code WC 10.6.2

function woocommerce_mini_cart( $args = array() ) {

	$defaults = array(
		'list_class' => '',
	);

	$args = wp_parse_args( $args, $defaults );

	wc_get_template( 'cart/mini-cart.php', $args );
}