<a class="cart-contents" href="<?php echo wc_get_cart_url(); ?>" title="<?php _e( 'View your shopping 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> |
This comment has been minimized.
This comment has been minimized.
Thanks so much! I wish they would improve their documentation to make this stuff a little easier to find... |
This comment has been minimized.
This comment has been minimized.
Hi, tnx for the code. |
This comment has been minimized.
This comment has been minimized.
I need to use the total number of items in cart for my new shipping method, but I dont understand how to use this for that. Using only $woocommerce->cart->cart_contents_count doesnt seem to work? |
This comment has been minimized.
This comment has been minimized.
Perfect! Thanks a million! |
This comment has been minimized.
This comment has been minimized.
This is exactly what I was looking for. Thanks! |
This comment has been minimized.
This comment has been minimized.
thank you so much boss! feeling happy..:-) |
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
Can this apply in email template? |
This comment has been minimized.
This comment has been minimized.
thanks |
This comment has been minimized.
This comment has been minimized.
Hi ! How can I get the number of items of Current Product in cart at product single page????? Thanks |
This comment has been minimized.
This comment has been minimized.
I use this way global $woocommerce; |
This comment has been minimized.
This comment has been minimized.
Hello, I hope this is in the right thread...I'd like to display the cart total in the menu bar, but on both a main AND subdirectory site. Woocommerce is installed on the main site: https://stephaniedaviesarai.com - from where it will be possible to buy a book. I've had to create a mirror install in a sub-directory (which looks identical) in order for my client to have two distinct blogs. This is effectively a one-page site at http://stephaniedaviesarai.com/cwc/cwc-blog/ The problem is that when you move to the second blog, you lose the cart. I know I can just have a straight link to the cart on the main site, but I lose the total in cart. I'm look to put Your Cart - $20.00 in both menus. Can I do that? Thanks for any and all help! |
This comment has been minimized.
This comment has been minimized.
Great! |
This comment has been minimized.
This comment has been minimized.
WOW someone out there thought that a plugin would be better, this works perfect. |
This comment has been minimized.
This comment has been minimized.
does not work as a dropdown |
This comment has been minimized.
This comment has been minimized.
Doesn't update on cart page while updating products. need to refresh for new updated count. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Perferct works. I share a function that conditions if you do not have products in the cart, do not show us anything.
|
This comment has been minimized.
This comment has been minimized.
Here is a plugin that allows you to add a shortcode displaying cart count and total: https://wordpress.org/plugins/woo-cart-count-shortcode/ |
This comment has been minimized.
This comment has been minimized.
Hey guys, what if I want to show the amount of unique items in cart? any hint? |
This comment has been minimized.
This comment has been minimized.
@ morenojavier |
This comment has been minimized.
This comment has been minimized.
Thanks dude! |
This comment has been minimized.
This comment has been minimized.
how to cart in product count in woocommerce |
This comment has been minimized.
This comment has been minimized.
my problem solve |
This comment has been minimized.
This comment has been minimized.
What about displaying the total of products without variations. i.e. I have 3 products and one of those have 2 variations so |
This comment has been minimized.
This comment has been minimized.
I have a problem in internet explorer, when I update the number of products on the cart page if it does, but in internet explorer 11 is not updated, I know, nobody uses internet explorer 11, except my client. |
This comment has been minimized.
This comment has been minimized.
Thanks, used with user login/out and account link as email.
|
This comment has been minimized.
This comment has been minimized.
ı use mesmerize theme ... how can i remove cart-contents-content ? |
This comment has been minimized.
This comment has been minimized.
in which file can I find someone tell the removal process |
This comment has been minimized.
This comment has been minimized.
Update 2019 for PHP 7+ use this code Source code >> https://easyshop.buuscript.com |
This comment has been minimized.
This comment has been minimized.
Where can I add this code? I am using code snipet plugin and gives error
|
This comment has been minimized.
This comment has been minimized.
thank you ! |
This comment has been minimized.
If I'm using a child theme, where do I need to place the above code? I'm using Canvas theme.