Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Cart/checkout
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2011 at 17:58 UTC
Updated:
20 Nov 2011 at 16:40 UTC
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
Comment #1
longwaveI would look at how http://drupal.org/project/uc_attributes_in_cart works as it is very similar to this request.