[Resolved] Customize the Mini Cart using WooCommerce Hooks

Home Forums Support [Resolved] Customize the Mini Cart using WooCommerce Hooks

Home Forums Support Customize the Mini Cart using WooCommerce Hooks

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #884274
    Arthur

    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 &times; %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)

    #884471
    Arthur

    Resolved. Must have been a caching issue.

    #884543
    Tom
    Lead Developer
    Lead Developer

    Glad you got it working 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.