Created
January 13, 2019 10:58
-
-
Save mmh4560/715a8d8f313c8e0559eb224aa25ce86d to your computer and use it in GitHub Desktop.
How to add Woocommerce Cart Icon in home page
This file contains 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
<!-- Use this code where do you want to show your cart icon --> | |
<div class='my-cart'> | |
<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e('View Cart'); ?>"><?php echo sprintf ( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count() ), WC()->cart->get_cart_contents_count() ); ?> - <?php echo WC()->cart->get_cart_total(); ?></a> | |
</div> | |
/* Here is css */ | |
.cart-contents::before { | |
font-family: WooCommerce; | |
content: "\e01d"; | |
font-size: 20px; | |
font-style: normal; | |
vertical-align: bottom; | |
padding-right: 10px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment