How to add edit link within add to cart form in ubercart drupal 7? I need to add edit link within add to cart form in ubercart in Drupal 7.
I am using hook_form_uc_cart_view_form_alter() hook but not getting how to add edit link within this hook.
This is probably confusing due to UC's reliance on TAPIr to render the cart items. Anyway, you can modify data inside in the $form['items'] array to change the output of those elements. For example, if you wanted to add an edit link underneath the product description:

function MYMODULE_form_uc_cart_view_form_alter(&amp;$form, &amp;$form_state) {
  foreach($form['items'] as $key =&gt; $value) {
    //Check a TAPIr row for a product associated with an editable nid
    if(is_int($key) &amp;&amp; isset($value['nid']['#value']) &amp;&amp; isset($value['desc'])) {
      if(node_access('update', $value['#entity'], $user)) {
        $form['items'][$key]['desc']['#markup'] .= l('(EDIT)', 'node/'.$value['nid']['#value'].'/edit');
      }
    }
  }


There might be a cleaner way to do this, but I haven't thought about TAPIr in a while.