Can't get this to work...

Joined: 01/20/2009
Juice: 392

Hi

I followed these instructions, and have:

optional_sku.info

; $Id$
name = Optional SKU
description = Makes the SKU for a product optional
package = Custom

and

optional_sku.module

<?php
// $Id$

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

/**
* Implementation of hook_form_alter()
*/
function optional_sku_form_alter($form_id, &$form) {
  if ($form_id == 'product_node_form') {
    $form['base']['model']['#required'] = FALSE;
  }
}

I've enabled the module, but the SKU still shows up as required. I have a string override that changes 'SKU' to 'Product Code'.

What have I done wrong?

Thanks

Glenn

UPDATE:

It works when I create a product, but when I create another content type which is also a product, it doesn't work.

Glenn

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