Changing the WooCommerce Item Cart Count Text

This is a draft tip, meaning that it hasn't been extensively tested and may not work perfectly.
It is not yet included in Divi Booster, but I hope to be able to do so in the future.

The Divi Theme comes with WooCommerce integration. As part of this, when a user adds items from your WooCommerce store into their cart, a cart icon will show up in the Divi header. Alongside this is text showing how many items are in the cart, e.g. "3 Items". But what if you want to modify this text, e.g. to translate it to match the language of your site? Here's one way to do it.

I've previously written about changing the WooCommerce cart icon text in Extra. The code I posted there won't work on Divi, but with a few modifications is can be made to do so. Here's the modified PHP code:

This example will change the text from "3 Items" to "3 Articles", but you can easily change this by modifying the words "Article" and "Articles" in the above to the singular and plural form of your required text, respectively.

Want get more out of Divi?

Hundreds of new features for Divi
in one easy-to-use plugin

Submit a Comment

Your email address will not be published. Required fields are marked *