This code enables you to modify the mini cart block title via the safety of your child theme.
By default, the mini cart displays Your cart ( x items ). This text can be changed using code.
On the left is the default Your cart(2 items) text and on the right is the modified text.
Code Installation
There’s 2 steps :
- Upload the file named mini-cart-block-title.js to your child theme folder.
- Copy & paste the PHP code from the functions.php file to your child themes functions file.
Modification
In the mini-cart-block-title.js file :
- On line 60 you can change the text from item(s) to anything you like.
- On line 76 you can change the In cart text to anything you like.