Возможно, это неправильный способ, но я создал небольшой модуль, который подключается к операции вставки nodeapi:
<?php
function photo_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'photo_node_form'){
$form['base']['model']['#default_value'] = 'placeholder';
}
}
function photo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch($op){
case 'presave':
if($node->model == 'placeholder')
$node->model = $node->field_image_cache2[0]['filename'];
break;
case 'insert':
$nid = $node->nid;
$sku_dl = $node->model.'d';
//====== Setup Adjustments ======
db_query('INSERT INTO {uc_product_adjustments} (nid,combination,model) VALUES'
.'('.$nid.',"%s","'.$sku_dl.'"),'
.'('.$nid.',"%s","'.$sku_dl.'"),'
.'('.$nid.',"%s","'.$sku_dl.'"),'
.'('.$nid.',"%s","'.$sku_dl.'"),'
.'('.$nid.',"%s","'.$sku_dl.'")'
,serialize(array('1'=>'1'))
,serialize(array('1'=>'3'))
,serialize(array('1'=>'4'))
,serialize(array('1'=>'5'))
,serialize(array('1'=>'6'))
);
//====== Add file download on purchase ======
$file_name = $node->field_image_cache2[0]['filename'];
db_query("INSERT INTO {uc_files} (filename) VALUES ('%s')",$file_name);
db_query("INSERT INTO {uc_file_products} (pfid, fid, model, description, shippable) VALUES (%d, LAST_INSERT_ID(), '%s', '%s', %d)", 0, $sku_dl, '', 1);
db_query('UPDATE {uc_file_products} SET pfid = LAST_INSERT_ID() WHERE fpid = LAST_INSERT_ID() LIMIT 1');
db_query("INSERT INTO {uc_product_features} (pfid, fid, nid, description) VALUES (LAST_INSERT_ID(), '%s', %d, '%s')", 'file', $nid, '<b>Filename</b><br/>'.$file_name.'<br/> <b>Reference</b> : '.$sku_dl);
break;
}
}