Can I use hook_uc_add_to_cart to ask for a yes/no confirmation before adding to cart? For certain products in my ubercart catalog, I need to show a legal disclaimer before actually adding them to the cart.
I was thinking to use hook_uc_add_to_cart for this, because it allows me to return a message in the result array : 

http://api.ubercart.me/api/drupal/ubercart!uc_cart!uc_cart.api.php/function/hook_uc_add_to_cart/7

I could return a html enriched message holding the anchor to the final cart addition, in case the legal notice is read and confirmed.

For example : How do I translate this submit input form to a query string like alternative ?

&lt;input class="node-add-to-cart form-submit" type="submit" id="edit-submit-144" name="op" value="Add to cart"&gt;


As an alternative I could ask the 'shopper' to hit this submit a second time as confirmation.

Then: To bypass the hook a second time, I could add a confirmed Boolean into the $data array which is returning into this hook as 3th parameter.

If I add this Boolean into the $data as a new key->value pair, will it be available again in the next submission ?
I was able to solve this issue using the first answer on this stackoverflow question : https://stackoverflow.com/questions/10490253/how-to-save-a-session-variable-in-drupal-7

In general: Drupal's static $_SESSION array variable allows to store key=>value pairs between different node pages, in my case the same page.

My code snippet inside uc_product_minmax_uc_add_to_cart hook :

    if (!empty($disclaimer)) {

        $confirmed = lists_session("s_key");

        if(! $confirmed) {

            $message[] = t($disclaimer, array('@qty' =&gt; $minmax-&gt;pmin_multiple, '!item' =&gt; $node-&gt;title));
            $result[] = array(
                'success' =&gt; FALSE,
                'message' =&gt; theme_item_list(array('items' =&gt; $message, 'title' =&gt; t('Read this note from medical department before confirming your reservation :'), 
                'type' =&gt; 'ul', 'attributes' =&gt; array())),
                'silent'  =&gt; FALSE,
            );
            lists_session("s_key", TRUE);
        }
    }