Last active
January 19, 2017 10:42
-
-
Save jameskoster/1730006 to your computer and use it in GitHub Desktop.
WooCommerce - Checkout link (when cart is not empty)
This file contains hidden or 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
global $woocommerce; | |
if ( sizeof( $woocommerce->cart->cart_contents) > 0 ) : | |
echo '<a href="' . $woocommerce->cart->get_checkout_url() . '" title="' . __( 'Checkout' ) . '">' . __( 'Checkout' ) . '</a>'; | |
endif; |
The closing Anchor is missing a final quote
<?php 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
Add if you want to use in your templates