Vote up!
Vote down!

How can I have my "Add to Cart Form" display even when there is only one product

I've been using Drupal Commerce for about 1 year now as an on-line box office for a theatre company (www.farmersalleytheatre.com). Everything has been going great except for we recently ran into an issue when there is only 1 product type left, the Add to Cart Form doesn't display the product list anymore. In my setup, each product is a ticket to a particular show. As the shows either sell-out or their date has passed, the site admin goes in and disables the respective tickets. This eventually gets us to a situation where there is only 1 product left and then the product drop-down completely disappears from the page. I have not been able to figure out a way to keep it displaying even if there is only one product.

You can see my particular setup on the box office page (http://farmersalleytheatre.com/box-office). Right now the work-around is to keep an older show active, but that obviously is not an ideal solution. Any help would be greatly appreciated.

Asked by: Chris Honeysett
on October 10, 2014

1 Answer

Vote up!
Vote down!


You can force the attributes to show on the "Display formatter" for the Product Reference field. See example below:

The path for the admin interface for a standard Drupal Commerce store looks like this:


Where "product_display" is the content type that you use to display your products.


Josh Miller
Answer by: Josh Miller
Posted: Oct 10, 2014


Thank-you for the prompt response!

The product attributes are showing fine, even if there is only one product - it's the drop-down that contains the product itself that is disappearing when there is only 1 "product" (in my case performance) still available. I create a product per performance and then have Adult / Student / Senior as attributes on that product.

- Chris Honeysett on October 11, 2014