Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function header_add_to_cart_fragment( $fragments ) {
global $woocommerce;
ob_start();
woocommerce_cart_link();
$fragments['a.cart-button'] = ob_get_clean();
return $fragments;
}
add_filter('add_to_cart_fragments', 'header_add_to_cart_fragment');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.