So I am using hook_form_alter to alter the add-to-cart button for my Ubercart pages. See here:
function hook_form_alter(&$form, &$form_state, $form_id) {
if ( !empty($form['nid']) ) {
$node = $form['nid']['#value'];
}
else {
$node = 0;
}
if (($form_id == 'uc_product_add_to_cart_form_'.$node) and ($form['node']['#value']->type =='product')){
hide($form['actions']['submit']);
$form['button'] = array(
'#prefix' => '<button type="submit" id="edit-submit-'. $node .'" name="op" class="node-add-to-cart btn btn-cart">',
'#suffix' => '</button>',
'#markup' => 'Buy for: ',
'#weight' => 1,
);
}
}
This works great. Except, in my form['button'] array, want to change the button markup to something like: 'Buy for: $10'.
How can I access the node's list and selling price so that I can use it in the markup of the button?