I installed clean drupal with ubercart and feeds. Configured one attribute "Pieces per pack" and created feed import. Then i mapped title, sell price and all options' prices.

Now i import record, like
title;sell_price;18pieces;90pieces
"Pumpers";100;0;50

In new node "18 pieces" become default option with price 0 and "90 pieces" with price 50, but "18 pieces" checkbox is not checked. So, on product page "18 pieces" option doesn't appear.

Edit: if product has only one option with price 0, the attribute even has not been attached to product node.

CommentFileSizeAuthor
default_option_not_checked.png3.42 KBUfurf
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ufurf’s picture

Issue summary: View changes
Ufurf’s picture

Ok

There is a check:

// If value is empty, it's not an attribute we want to use
if (!empty($value)) {
   $node->uc_feeds['attributes'][$aid]->options[$oid]->$key = $value;
}

But 0 recognized as empty and this value even not been recorded in database.

So, i think we should use if($value != ''), like it is in current 7.x-1.0 version

haysuess’s picture

I'm seeing this same behavior. How can this be fixed?

haysuess’s picture

I can confirm replacing

if (!empty($value))

with

if ($value != '')

works and allows proper importing of attribute options with a 0 price alteration.