Custom warning on when viewing cart (anonymous users)
The easiest way is overriding a default cart page template (cart page has been created with Views module, name - 'commerce_cart_form', display - 'default');


Create a template for Style Output
Copy the content of it
Views module provides logged_in variable in template_preprocess_views_view(&amp;$vars) function, so you can check with that variable and display a text;


example (views-view-table--commerce-cart-form--default.tpl.php):

&lt;?php if (!$logged_in): ?&gt;
  MY MESSAGE FOR THE ANONYMOUS
&lt;?php endif; ?&gt;

&lt;table &lt;?php if ($classes) { print 'class="'. $classes . '" '; } ?&gt;&lt;?php print $attributes; ?&gt;&gt;
  // Rest of code from Style Output
&lt;/table&gt;