Need to update supported/ubercart/uc_product.inc on line 15 from uc_product_node_is_product to uc_product_is_product. I got a white screen when trying to import a non-ubercart product node type (I have the latest Ubercart 2.x installed and active).

Comments

joachim’s picture

It's been renamed uc_product_is_product():

all/modules/ubercart/uc_product/uc_product.module:function uc_product_is_product($node) {

matteoraggi’s picture

I hav the same problem with RC7 of ubercart 2 and drupal 6.14 then I have added this code on the top of uc_product.inc and then it go on the next page :
function uc_product_node_is_product($type) {
if (strpos($type, 'product') === 0) {
return TRUE;
}
return FALSE;
}
?>

but then it is showing on th top this long mesage at step 4:
function uc_product_node_import_fields($type) { $fields = array(); if (($node_type = node_import_type_is_node($type)) !== FALSE && uc_product_node_is_product($node_type)) { $fields['model'] = array( 'title' => t('SKU'), 'group' => t('Product information'), 'weight' => 1, ); $fields['list_price'] = array( 'title' => t('List price'), 'group' => t('Product information'), 'weight' => 2, ); $fields['cost'] = array( 'title' => t('Cost'), 'group' => t('Product information'), 'weight' => 3, ); $fields['sell_price'] = array( 'title' => t('Sell price'), 'group' => t('Product information'), 'weight' => 4, ); $fields['shippable'] = array( 'title' => t('Shippable'), 'group' => t('Product information'), 'input_format' => 'boolean', 'weight' => 5, ); $fields['weight'] = array( 'title' => t('Weight'), 'group' => t('Product information'), 'weight' => 6, ); $fields['weight_units'] = array( 'title' => t('Weight unit'), 'group' => t('Product information'), 'allowed_values' => array('lb' => t('Pounds'), 'kg' => t('Kilograms'), 'oz' => t('Ounces'), 'g' => t('Grams')), 'default_value' => variable_get('uc_weight_unit', 'lb'), 'weight' => 7, ); $fields['length_units'] = array( 'title' => t('Dimensions unit'), 'group' => t('Product information'), 'allowed_values' => array('in' => t('Inches'), 'ft' => t('Feet'), 'cm' => t('Centimeters'), 'mm' => t('Millimeters')), 'default_value' => variable_get('uc_length_unit', 'in'), 'weight' => 8, ); $fields['length'] = array( 'title' => t('Length'), 'group' => t('Product information'), 'weight' => 9, ); $fields['width'] = array( 'title' => t('Width'), 'group' => t('Product information'), 'weight' => 10, ); $fields['height'] = array( 'title' => t('Height'), 'group' => t('Product information'), 'weight' => 11, ); $fields['pkg_qty'] = array( 'title' => t('Package quantity'), 'group' => t('Product information'), 'weight' => 12, ); $fields['default_qty'] = array( 'title' => t('Default cart quantity'), 'group' => t('Product information'), 'default_value' => 1, 'weight' => 13, ); $fields['ordering'] = array( 'title' => t('List position'), 'group' => t('Product information'), 'input_type' => 'weight', 'delta' => 25, 'default_value' => 0, 'weight' => 14, ); } return $fields; }

joachim’s picture

Try fixing the call rather than adding a function, maybe?

matteoraggi’s picture

StatusFileSize
new151.6 KB

Ops, I'm not a developer, ho to do that? Anyway at the end It import only one lne and I get thi attached error report.

matteoraggi’s picture

StatusFileSize
new155.34 KB

here an'other sample of import with a csv file with english headers, but it again also int oa different taxonomy it imort only the first line

matteoraggi’s picture

I have solved problem to import my nodes overwriting last code with this patch file: http://drupal.org/files/issues/uc_product.zip
And I hope it will be all right also to import products of ubercart.

joachim’s picture

That's not a patch.
And: it seems to me everyone is fixing the wrong thing.

The original poster says the right thing:
Change uc_product_node_is_product to uc_product_is_product.

Robrecht Jacques’s picture

Status: Active » Closed (duplicate)

Duplicate of http://drupal.org/node/555202 which has been fixed and will be included in -rc5.