For each of my products in the store there is an attribute where the user can select the SIZE they want shipped.

I have used the hook HOOK_tapir_table_alter(&$table, $table_id) to modify the cart view before checkout but I'm not quite sure how to render the selected attributes for a product?

For example I have:

$keys = element_children($table);
$lastKey = end($keys); // the TOTAL element

foreach ($keys as $key) {
   if (empty($table[$key]['nid']['#value'])) continue;

   $n = node_load($table[$key]['nid']['#value']);
   
   $table[$key]['total']['#price'] = $n->sell_price;

   $table[$key]['size_item'] = array(
      '#markup' => <strong>WHAT DO I PUT HERE TO GET THE SIZE ATTRIBUTE FOR THIS PRODUCT?</strong>
      '#cell_attributes' => array('class' => 'size-item'),
   );
}

How do I get the size they selected for the items added to cart? Right now I can load the node to add some data into the cart view but it doesn't have their cart data? Do I somehow need to access uc_get_cart_contents() and the items in the cart? or the $order = $_SESSION['cart_order'];

Thanks in advance!

Comments

longwave’s picture

Status: Active » Fixed

I would look at how http://drupal.org/project/uc_attributes_in_cart works as it is very similar to this request.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.