Plugin Contributor
Ewout
(@pomegranate)
You can use wpmenucart_menu_item_a_content:
add_filter( 'wpmenucart_menu_item_a_content', 'wpmenucart_item_text', 10, 4 );
function wpmenucart_item_text ( $menu_item_a_content, $menu_item_icon, $cart_contents, $item_data ) {
if ($item_data['cart_contents_count'] == 0) {
$menu_item_a_content = 'shopping cart';
} else {
$menu_item_a_content = $menu_item_a_content . '- shopping cart';
}
return $menu_item_a_content;
}
Hope that helps!
Works perfectly! Thank you!!
Plugin Contributor
Ewout
(@pomegranate)
You’re welcome! If you have some time for a review, we’d really appreciate that!
Ewout
Hi,
I put the filter in my themes functions.php file, and it works for a second or two, but as the page loads the text I put in gets replaced (I’m guessing by some javascript somewhere) with the default “ITEM/ITEMS” text. Any ideas? Thanks
Plugin Contributor
Ewout
(@pomegranate)
Hi! Are you using a Genesis Theme with the Dynamik website builder? If so, make sure the scripts are allowed when you’re in the admin: https://ww.wp.xz.cn/support/topic/changing-title-of-0-items?replies=10#post-7183969
Also, please double check that you’re not seeing cached AJAX fragments by closing the browser tab and opening the site again in a new tab. AJAX fragments can be quite persistent.
Let me know if that helps!
Ewout
It was cached AJAX! To be honest, when I came back to work on it the next day it was working fine so I completely forgot about it! But yes, I tested it again to be sure and closing the tab and reopening it fixes the issue.
Thanks!