Skip to content

Instantly share code, notes, and snippets.

@hemusyl
Forked from raselahmed7/cart-functions.php
Created July 30, 2019 21:53
Show Gist options
  • Save hemusyl/8c5a99bb03772f3e099a18cd71597083 to your computer and use it in GitHub Desktop.
Save hemusyl/8c5a99bb03772f3e099a18cd71597083 to your computer and use it in GitHub Desktop.
function woocommerce_cart_link() {
global $woocommerce;
?>
<a href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?>" title="<?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> <?php _e('in your shopping cart', 'woothemes'); ?>" class="cart-button ">
<span class="label"><?php esc_html_e('My Basket:', 'woothemes'); ?></span>
<?php echo esc_html($woocommerce->cart->get_cart_total()); ?>
<span class="items"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count); ?></span>
</a>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment