Skip to content

Instantly share code, notes, and snippets.

@neilgee
Forked from jameskoster/header.php
Last active September 25, 2015 00:18
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 neilgee/10e4777b942487cb1200 to your computer and use it in GitHub Desktop.
Save neilgee/10e4777b942487cb1200 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 && !is_cart() && !is_checkout() ) :
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