How do I hide the AJAX Cart block when cart is empty? How can I hide Ubercart AJAX Cart block when the user's shopping cart is empty?

I know I could hide it with some jQuery tricks (for example, looking for the "cart-empty" class under my AJAX cart block (which has the class "block-uc_ajax_cart"), and hide the whole block if I found it), but this way I also would have to solve if cart is updated... Too messy.

I haven't found any opportunities to hide the block in this case under block settings, nor under the AJAX Cart Settings (http://&lt;mysite&gt;/admin/store/settings/uc_ajax_cart).

Thanks for your help in advance!
OK, in the meantime I found the solution.

1.) Set "Block title" in the appropriate block configuration to &lt;none&gt;. (http://&lt;mysite&gt;/admin/build/block/configure/uc_ajax_cart/0) (you'll see later why)

Block title:
&lt;none&gt;

2.) Copy the UC AJAX Cart template files (uc_ajax_cart_block_content.tpl.php, uc_ajax_cart_block_content_empty.tpl.php) from http://&lt;mysite&gt;/sites/all/modules/uc_ajax_cart/templates/
to your own theme's templates directory (http://&lt;mysite&gt;//sites/all/themes/&lt;mytheme&gt;/templates/).

3.) After that, open both copied files (which are now in your template directory) in a text editor.

4.) Delete (or put in a comment) the content of uc_ajax_cart_block_content_empty.tpl.php, and upload the edited file to the server.

5.) Prepend the following to uc_ajax_cart_block_content.tpl.php to have the block title back:

&lt;h2 class="title"&gt;
    &lt;span class="title block-title" id="ajax-cart-headline"&gt;
        &lt;a href="#" id="ajaxCartToggleView" class="ajax-cart-processed"&gt;&lt;?php print t('Shopping cart')?&gt;&lt;/a&gt;
    &lt;/span&gt;
&lt;/h2&gt;


(The rest should stay intact!!)

6.) Clear the theme registry cache (http://&lt;mysite&gt;/admin_menu/flush-cache/theme), and you're done.



UPDATE:
the method above breaks the toggling opportunity of the shopping cart content (if the following is checked in the settings: "Make the shopping cart block collapsible by clicking the name or arrow.") when clicking on the block title ("Shopping Cart"), because the title part is also updated with AJAX from the uc_ajax_cart_block_content.tpl.php file, BUT there IS a solution in jQuery, which you have to put in your own JavaScript-file (which is e.g. put in your theme's .info file), and it looks like this:

$(document).ready( function(){
    if( $('#ajaxCartToggleView').length &gt; 0 ){
        // live: "Attach an event handler for all elements which match the current selector, now and in the future." (http://api.jquery.com/live/)
        $("#ajaxCartToggleView").live("click", function(){
            ajaxCartToggleView();
            return false;
        });
    }
}