0
  1. ubercart in add to cart button i want to change this as image of [add_to_cart.jpg].
  2. How to update cart page with extra columns like unit price ..
  3. Add extra column in ubercart cart-page by default this is table format.here some filed like [remove ,title,unit,total].

Thanks

LAv RAi
  • 31
  • 7
  • *I want* and *please give me solution asap.* do ***not*** make us want to help you. Furthermore, your question is pretty illegible right now. I'd spend some time editing your question to make it more readable and less rude if you want to get any useful help. – Matt Jul 19 '12 at 10:40
  • we use in drupal 7 ubercart 3. here we use this function for update cart page. hook_form_uc_cart_view_form_alter. i got a solution . – LAv RAi Aug 04 '12 at 10:58

1 Answers1

0

we use in drupal 7 ubercart 3. here we use this function for update cart page.

This is answer of 2 question.

** hook_form_uc_cart_view_form_alter**. we got a solution .

implementation like.. 
function modulename_form_uc_cart_view_form_alter(&$form, &$form_state) {

  if (count($form['items'])) {
    // Add edit column to tapir table.
    $form['items']['#columns']['unit'] = array(
      'cell'   => t('Unit Price'),
      'weight' => 2,
    );

    // Add edit link to all products.
    foreach (element_children($form['items']) as $key) {

      if (isset($form['items'][$key]['cart_item_id'])) {

         $form['items'][$key]['unit'] = array(
         '#markup' =>t(uc_currency_format(sprintf ("%.2f", $form['items'][$key]['#entity']->sell_price ))),
        );

      }
    }
  }
}
LAv RAi
  • 31
  • 7