How to replace all Add To Cart buttons with alternative text in Ubercart for anonymous users?
I think I've got the solution. Any feedback would be greatly appreciated.

&lt;?php
function uc_disable_cart_button_for_anonymous_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    /* Overrides the Add to Cart form text*/
    if ( !empty($form['nid']) ) {
      $node = $form['nid']['#value'];
    }
    else {
      $node = 0;
    }
    switch ($form_id) {
        case (($form_id == 'uc_product_add_to_cart_form_'.$node)):
        // hide add to cart button for anonymous users and show text
        if(!user_is_logged_in()) {
            unset($form['actions']['submit']);
            $form['html_markup'] = array('#markup' =&gt; t('&lt;div class="login-to-buy"&gt;Please login or apply for a Member account in order to proceed.&lt;br&gt;&lt;br&gt;&lt;a href="/user/login" class="btn"&gt;Log In&lt;/a&gt; &amp;nbsp; &lt;a href="/user/register" class="btn"&gt;Apply for Member account&lt;/a&gt;&lt;/div&gt;'));
        }
        if(user_is_logged_in()) {
            $form['actions']['submit']['#value'] = 'Add to Order';
            $form['actions']['submit']['#prefix'] = '&lt;div id="form-button-wrapper"&gt;';
            $form['actions']['submit']['#suffix'] = '&lt;/div&gt;';
        }
        break;
    }

    /* Overrides the Buy It Now form text*/
    if ( !empty($form['nid']) ) {
      $node = $form['nid']['#value'];
    }
    else {
      $node = 0;
    }
    switch ($form_id) {
        case (($form_id == 'uc_catalog_buy_it_now_form_'.$node)):
        // hide buy it now button for anonymous users and show text
        if(!user_is_logged_in()) {
            unset($form['actions']['submit']);
            $form['html_markup'] = array('#markup' =&gt; t('&lt;div class="login-to-buy"&gt;Please login or apply for a Member account in order to proceed.&lt;br&gt;&lt;br&gt;&lt;a href="/user/login" class="btn"&gt;Log In&lt;/a&gt; &amp;nbsp; &lt;a href="/user/register" class="btn"&gt;Apply for Member account&lt;/a&gt;&lt;/div&gt;'));
        }
        if(user_is_logged_in()) {
            $form['actions']['submit']['#value'] = 'Add to Order';
            $form['actions']['submit']['#prefix'] = '&lt;div id="form-button-wrapper"&gt;';
            $form['actions']['submit']['#suffix'] = '&lt;/div&gt;';
        }
        break;
    }
}


The main drawback that I see is that the quantity and attribute fields are still displayed, but that could be good or bad based on use-case. I'd prefer to hide them, so I may try to figure that out.