Created
October 25, 2017 09:49
-
-
Save mjinayan80/d3a7e7b6d40aead724b5ac143067fa32 to your computer and use it in GitHub Desktop.
cart-functions-filter.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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