When I have only one product for a display, and check "Show attribute widgets even if the Add to Cart form only represents one product." in the display of the related line item's product field, it is still a hidden field and not a select list with one option.

Comments

mimrock’s picture

Proposed patch. To tell the truth, I haven't done extensive study and testing about this, but it seems to solve my problem on my site.

mimrock’s picture

Status: Active » Needs review
rajmataj’s picture

This has been an issue for almost a year for me. Applied this to /profiles/commerce_kickstart/modules/contrib/commerce/modules/cart/commerce_cart.module and it worked!!! Using: Drupal 7.26 with commerce_kickstart-7.x-2.12.

Thank you thank you thank you!!

Update: 2014-04-01:

Confirmed this patch is still necessary with Drupal 7.26 with commerce_kickstart-7.x-2.13

rajmataj’s picture

Priority: Normal » Critical

Updating to critical since a product with only one active variation will not display its information at all for front-end users.

rszrama’s picture

Category: Bug report » Support request
Priority: Critical » Normal
Status: Needs review » Closed (works as designed)

This is working as designed. Attribute fields are unrelated to the product select list that appears if you aren't using attribute fields and have more than one product referenced on a form. That's simply a product select list, not an attribute field widget.

gregoryshearer’s picture

OK then how do we show the "product select list" if it has only one product to display.

My use case is similar to this and, like I commented there, "showing a dropdown with only one option is bad ux" is a really bad answer.
https://drupalcommerce.org/questions/18691/how-can-i-have-my-add-cart-fo...