How to remove product links from the shopping cart block in Ubercart

Warning message

JQuery Cycle must be installed in order to run the slideshow. Please go to Status Report for instructions.

Primary tabs

Sometime you want to remove the anchor tags or links from the product links from the shopping cart block. To do this you have to override the uc_cart_block_items() in your

template.php file. Then search for the link and remove that from function. Here is a sample of this (with removed links from that function) :  you have to copy and paste this function into your current theme template file . Then replace the YOURTHEMENAME with your current theme name.


function YOURTHEMENAME_uc_cart_block_items($items) {
  if ($items) {
    $output = '';
    $row_class = 'odd';

    $context = array(
      'revision' => 'themed',
      'type' => 'price',
    );
    foreach ($items as $item) {
      $context['subject'] = array(
        'cart_item' => $item,
        'node' => node_load($item['nid']),
      );
      
      $output .= ''. $item['qty'] .''
                .''. strip_tags($item['title']) .''
                .''. uc_price($item['price'], $context) .'';

      if ($item['desc']) {
        $output .= ''. $item['desc'] .'';
      }
      $row_class = ($row_class == 'odd') ? 'even' : 'odd';
    }

    $output .= '';
  }
  else {
    $output = '

'. t('There are no products in your shopping cart.') .'

'; } return $output; }
Ubercart Shopping block with no product links