Problem/Motivation

When using commerce_product_reference widget, autocomplete return @sku: @title as label, but only sku as title. So after selecting product in list, only sku is displayed in field.

This is not user-friendly, and contributors should see both sku and product title.

Currently:

Expected:

Proposed resolution

commerce_product_reference use drupal_explode_tags() on values to get skus, which can retrieve sku if it's surrounded by quotation marks.
So i suggest commerce_product_autocomplete() to return "@sku": @title instead of $data['rendered'] containing @sku: $title

User interface changes

Display "@sku": @title in product reference field instead of only skus.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GoZ created an issue. See original summary.

GoZ’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.67 KB
rszrama’s picture

I'm not sure this is a wise decision given the length limit of textfields. For sites that have a lot of product references or long product titles, they could end up losing data on a form edit / resubmission due to the length limit.

egarias’s picture

I share the more user friendly suggestion.
Thanks!