here is how I hide the sku input field:
uc_nosku.info
; $Id$
name = "No sku"
description = "Hides the sku input field on the edit product form and allocates its default value with 'default'."
dependencies[] = uc_product
package = "Ubercart (Optional)"
core = 6.x
php = 5.0uc_nosku.module
<?php
// $Id$
/**
* @file
* Hides the sku input field on the edit product form
* and allocates its default value with 'default'.
*/
/**
* Implementation of hook_form_alter().
*/
function uc_nosku_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == "product_node_form") {
$form['base']['model']['#default_value'] = 'default';
$form['base']['model']['#type'] = 'hidden';
}
}
?>Remember that there mustn't be a '?>' tag at the end of the .module file!
Create a directory ../sites/all/modules/ubercart/uc_nosku and save the files there.
@loocher
To change the label of the sku-field just add this line to the module above:
$form['base']['model']['#title'] = 'Just another label';