Skip to content

Instantly share code, notes, and snippets.

@aboglioli
Created August 5, 2016 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aboglioli/4a76914f8eede6f7e2664b214910dbd3 to your computer and use it in GitHub Desktop.
Save aboglioli/4a76914f8eede6f7e2664b214910dbd3 to your computer and use it in GitHub Desktop.
WooCommerce - Change cart button of the upper-right corner
<?php
// Cart Link
if ( !function_exists( 'cg_cart_link' ) ) {
function cg_cart_link() {
?>
<a class="cart-contents" href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'woocommerce' ); ?>">
<span class="count"><strong>Cart</strong>: <?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'woocommerce' ), WC()->cart->get_cart_contents_count() ) ); ?></span>
</a>
<?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment