function foo_form_alter(&$form, $form_state, $form_id) { if ($form['#id'] == 'node-form') { if (!empty($form['body_field'])) { $form['body_field']['teaser_js']['#type'] = 'hidden'; $form['body_field']['teaser_include']['#type'] = 'hidden'; } } }
Credit Snipplr.com
You first create some attributes for a product that have no options and are set as text field, then add to cart with their attribute IDs set.
<?php $form['Association_Name']['#title'] = $form['field_association_name']['#title']; $form['Association_Name']['#value'] = "<label><strong>Association Name:</strong></label><br />" . $form['field_association_name'][0]['#default_value']['value']; $form['Association_Name']['#weight'] = $form['field_association_name']['#weight']; $form['field_association_name']['#access'] = 0; ?>
$path = drupal_get_path_alias($_GET['q']);
$form['search_theme_form']['#attributes'] = array('onfocus' => "if (this.value == 'Search My Site') {this.value = '';}" );
This example makes an admin comment
uc_order_comment_save($order->order_id, 0, $str, 'admin');
<?php function phptemplate_preprocess_page(&$vars) { if(drupal_get_path_alias($_GET['q']) == 'cart/checkout/complete') { $vars['closure'] .= 'conversion script'; } } ?>
<?php $links = menu_primary_links(); foreach($links as $link): $x++; echo('<a href="' . url($link['href']) . '">' . $link['title'] . '</a> ' . ((count($links) == $x) ? "" : "|") ); endforeach; ?>
or
<?php $links = menu_navigation_links("primary-links"); foreach($links as $link): $x++; echo('<li><a href="' . url($link['href']) . '">' . $link['title'] . '</a></li> '); endforeach; ?>
Add this to template.php
<?php function phptemplate_preprocess_page(&$vars) { $args = arg(); if($args[0] == 'blog') { $vars['head_title'] = preg_replace("^Blogs^", "User's Blog", $vars['head_title']); $vars['title'] = "User's Blog"; } } ?>