Trying to get length, width, height and length units into my feed and strangely adding the following to uc_feeds_feeds_node_processor_targets_alter:
// Dims
$targets['length'] = array(
'name' => t('UC: Length'),
'callback' => 'uc_feeds_feeds_set_target',
'description' => 'Ubercart:'. t('Length'),
);
$targets['width'] = array(
'name' => t('UC: Width'),
'callback' => 'uc_feeds_feeds_set_target',
'description' => 'Ubercart:'. t('Width'),
);
$targets['height'] = array(
'name' => t('UC: Height'),
'callback' => 'uc_feeds_feeds_set_target',
'description' => 'Ubercart:'. t('Height'),
);
$targets['length_units'] = array(
'name' => t('UC: Dimension Units'),
'callback' => 'uc_feeds_feeds_set_target',
'description' => 'Ubercart:'. t('Dimension Units'),
);
Doesn't do the trick. Is there some other magic I'm missing? Thanks!
Mike
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | uc_feeds.dims_.patch | 1.46 KB | mpaler |
Comments
Comment #1
mpaler commentedThe reason is because the node object identifiers for dimensions differ from database ids...eg:
Node = $node->dim_length, $node->dim_width, $node->dim_height
Db = length, width, height
Attached is a patch that solves this problem.
Comment #2
dariusj18 commentedSo #1 I am confused by this patch. Does this mean that to make it import the dimensions we don't need to modify the "INSERT INTO {uc_product_options}" query To add the dimension fields to it?
Comment #3
tommeir commentedhere is another product settings I used for my import, thought sharing it...
Comment #4
dimitriseng commentedHi, I have tested all the above and it all works as expected.
Please see also issue #1031700: Stock Levels. The patch at #9 of that issue adds the stock functionality but also makes a few modifications to the code that are not compatible with the above solutions. Please see my comment #12 at that issue, hopefully all of this functionality can be commited in a uniform way, thanks.
Comment #5
vin247 commentedthis is just what I needed, thanks!!
Comment #6
Robin Millette commentedI'm working on fitting this patch with #1031700: Stock Levels with a new dev release out soon.
Comment #7
dubs commentedPatched...
Comment #8
proxima8 commented#1 patch works in 7.x but you need to rename callback method from "uc_feeds_feeds_set_target" to "uc_feeds_set_target".
Like this: