Fix for Fix for UC Node Checkout - Base Product Title into Token

  1. <?php
  2. // $Id$
  3. /**
  4.  * Provide node checkout product title token value.
  5.  */
  6. function aces_custom_token_values($type, $object = NULL, $options = array()) {
  7.   if ($type == 'node' && uc_product_is_product($object)) {
  8.     // get the product title from the node table
  9.     $product_title_get = db_query("SELECT title FROM {node} WHERE nid = %d", $object->nid);
  10.     $product_title = db_result($product_title_get, $row = 0);
  11.  
  12.     $tokens = array();
  13.     $tokens['product-title'] = $product_title;
  14.     return $tokens;
  15.   }
  16. }
  17.  
  18. function aces_custom_token_list($type = 'all') {
  19.   if ($type == 'node' || $type == 'product' || $type == 'ubercart' || $type == 'all') {
  20.     $tokens = array();
  21.     $tokens['product']['product-title'] = t("The base product's title for node checkout.");
  22.     return $tokens;
  23.   }
  24. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.