WooWeekly #316: Cart Items Counter

How you doing?

It’s a humid September Wednesday here in Sicily. September rain (was it “November” in a song?) has come and there’s no turning back. Summer is officially gone, and farmers are now approaching the harvest season. We’re ready to go with our bit of grapes as well, and right after we’ll look after picking olives – there is something magical about “making your own” wine and extra virgin olive oil! Go Sicily!

Anyhow, welcome back to our WooCommerce Weekly appointment – here comes a series of WooCommerce tutorials put together by yours truly so that you can learn something new.

New WooCommerce Tips

WooCommerce: How to Alter Cart Items Count

We’ve already seen how to exclude hidden products from the WooCommerce Mini-Cart widget counter; today I want to expand on the same concept and try to recalculate / alter such counter based on custom criteria. For example, some business models require to count the number of distinct items in the Cart, no matter their respective cart quantities. So, if there are 2x “Item 1” and 4x “Item 2”, this altered counter would show 1+1=2 and not 2+4=6. So, let’s see how this is done – enjoy: https://www.businessbloomer.com/woocommerce-how-to-alter-cart-items-count/

Author

  • Rodolfo Melogli

    Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza.

    View all posts

Proudly supported by

Join them?