Posted by xarchmaemo on February 23, 2013 at 4:08pm
I have Drupal 7.19 and Ubercart 7x-3.4. I would like to insert the product node's teaser into the checkout page. I found the code that handles the output of this, but I don't know how to implement. From another forum, I found this code, but it does not work for me.
Any suggestions would be greatly appreciated.
function uc_cart_view_form_alter(&$form, &$form_state) {
// Add a column for the description
$form['items']['#columns']['description']['cell'] = t('Description');
// for each product in the cart, add the description
foreach (element_children($form['items']) as $i) {
// load the node to get the description
$currentNode = node_load($form['items'][$i]['nid']['#value']);
// create the description element
// first clone the product name element (confusingly called "desc"), then populate it with the description
$form['items'][$i]['description'] = $form['items'][$i]['desc'];
$form['items'][$i]['description']['#value'] = $currentNode->teaser;
}
}NOTE: I am modifying the code in Ubercart Core.
Thanks in advance.