Skip to content

Instantly share code, notes, and snippets.

@krishna19
Forked from jameskoster/header.php
Created January 19, 2017 10:42
Show Gist options
  • Save krishna19/7c80e246817ef53d71fc95db35e394e6 to your computer and use it in GitHub Desktop.
Save krishna19/7c80e246817ef53d71fc95db35e394e6 to your computer and use it in GitHub Desktop.
WooCommerce - Checkout link (when cart is not empty)
global $woocommerce;
if ( sizeof( $woocommerce->cart->cart_contents) > 0 ) :
echo '<a href="' . $woocommerce->cart->get_checkout_url() . '" title="' . __( 'Checkout' ) . '">' . __( 'Checkout' ) . '</a>';
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment