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.
Comment | File | Size | Author |
---|---|---|---|
#2 | return_sku_and_title_in-2818303-2.patch | 1.67 KB | GoZ |
| |||
commerce_product_reference_widget_expected.png | 19.15 KB | GoZ | |
commerce_product_referece_widget_original.png | 14.45 KB | GoZ |
Comments
Comment #2
GoZ CreditAttribution: GoZ at Centarro commentedComment #3
rszrama CreditAttribution: rszrama at Centarro commentedI'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.
Comment #4
egarias CreditAttribution: egarias commentedI share the more user friendly suggestion.
Thanks!