Product with empty attribute values There are a couple of attributes in my product. If the product is added to the cart without choosing one or two attributes, the product goes to the cart, but unselected attributes are also showing up.

I want that attributes without values are not shown. How can I do this?
I tried using hook_product_description(), but it doesn't help.

I'm using Ubercart 6.x-2.7, and its Product attributes module.
Create a module to customize the cart form. Here's how I usually do it.

function custom_cart_form_alter(&amp;$form, $form_state, $form_id) {
  if ($form_id == 'uc_cart_view_form') {


    for($i=0;$i&lt;count($form['items']);$i++){
       //these are rows in your cart... that includes the "total" line etc, so make sure to check that the row has the data you need

       //I believe what you're looking for is in $form['items'][$i]['desc']['#value']
       //you're going to need to look for the empty tag, probably using a regex pattern and remove the whole &lt;li&gt; element
    }

  }
}