This topic has 7 replies, 2 voices, and was last updated 7 years ago ago by Rose Tyler
I’m trying to rebuild my site, and wish to change the text “Cart 0 items for 0 €” into just product amount in cart, so basically just “0”.
There is an old conversation about the topic, but I think the code has changed after that:
https://www.8theme.com/topic/change-cart-0-items-for-0e-into-0/
I added the css but the woo.php code has changed so much that the codes _e(‘ items for’, ETHEME_DOMAIN); and <?php etheme_cart_totals(); ?> are not written like that anymore.
What is the part of I should remove now?
I would rather have the product amount, instead of total sum. So if they would have five products in the cart it would show (5)
Like on screenshot – https://prnt.sc/h7sogo ?
Regards
yes
Hello,
In this case, add this code
function et_cart_summ() {
global $woocommerce;
?>
<a href="<?php echo wc_get_cart_url(); ?>" class="cart-summ" data-items-count="<?php echo WC()->cart->get_cart_contents_count(); ?>">
<div class="cart-bag">
<?php echo wp_kses_data( sprintf( '<span class="badge-number">(%1$u) %2$s</span>', WC()->cart->get_cart_contents_count(), _nx( '', '', WC()->cart->get_cart_contents_count(), 'top cart items count text', ETHEME_DOMAIN ) ) );?>
</div>
</a>
<?php
}
in function.php file of child theme.
Regards
Then clear cache and try to add some product to cart.
Regards
You must be logged in to reply to this topic.Log in/Sign up