WordPress at Your Fingertips
function is not described

WC_AJAX::get_refreshed_fragments() public WC 1.0

Get a refreshed cart fragment, including the mini cart HTML.

{} It's a method of the class: WC_AJAX{}

Hooks from the method

Return

null. Nothing.

Usage

$result = WC_AJAX::get_refreshed_fragments();

Code of WC_AJAX::get_refreshed_fragments() WC 5.9.0

public static function get_refreshed_fragments() {
	ob_start();

	woocommerce_mini_cart();

	$mini_cart = ob_get_clean();

	$data = array(
		'fragments' => apply_filters(
			'woocommerce_add_to_cart_fragments',
			array(
				'div.widget_shopping_cart_content' => '<div class="widget_shopping_cart_content">' . $mini_cart . '</div>',
			)
		),
		'cart_hash' => WC()->cart->get_cart_hash(),
	);

	wp_send_json( $data );
}