I’m trying to modify some sections of the Mini Cart output using the WC woocommerce_widget_cart_item_quantity hook (I want to display the price without the quantity). Using this hook in my themes functions.php file does NOT seem to be working. Here is my Hook code:
add_filter('woocommerce_widget_cart_item_quantity', 'custom_wc_widget_cart_item_quantity', 50, 3 );
function custom_wc_widget_cart_item_quantity( $output, $cart_item, $cart_item_key ) {
$output = '<span class="quantity hello">' . sprintf( '%s × %s', $cart_item['quantity'], $product_price ) . '</span>';
return $output;
}
The above code only adds a ‘hello’ class just to check if the code is working.
Any ideas why this hook is not working? (this is a members only site)