Re: Re: Re: Is this working on D6.9?

tcindie@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 05/15/2008
Juice: 440
Re: Re: Re: Is this working on D6.9?

you need a line that says core="6.x" in the info file for drupal 6 modules..

you will also need to give the SKU a default value, as it's a required field. Though you could probably set the #required attribute to FALSE.

my_module.info:

; $Id$
name = My Module
description = My customizations to Ubercart
package = Custom
core = "6.x"
dependencies[] = uc_cart

my_module.module:

<?php
// $Id$

/**
* @file
* Module to hold my customizations to Ubercart
*/

/**
* Implementation of hook_form_alter()
*/
function my_module_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'product_node_form') {
    $form['base']['model']['#type'] = 'hidden';
    $form['base']['model']['#default_value'] = 'default value';
    // Choose which method you want to use, the above line, or comment it out and uncomment the following line:
    // $form['base']['model']['#required'] = FALSE;
  }
}

Follow me on twitter.

Removing SKU on product edit page By: jag (48 replies) Tue, 12/11/2007 - 23:12