Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
User experience
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 Dec 2015 at 17:19 UTC
Updated:
15 Mar 2016 at 13:44 UTC
Jump to comment: Most recent
Right now the variation label is just the attributes: "Blue, small".
For the line item label we construct the full version using the product title: "MyShirt - Blue, small".
This looks weird on the line item form cause the autocomplete only shows "Blue, small".
We need to:
1) Do #2631168: Add a getLabel() method to inline forms in IEF
2) move the getLineItemTitle() logic to label(), make the attribute generation part a public method
3) Use the new public method in the inline form's getLabel() method
IEF keeps looking the same, line item form gets fixed.
Comments
Comment #2
harings_rob commentedI took a look at this and the patch in https://www.drupal.org/node/2631168 (applies fine, but could not completely test yet).
Currently I have created a Product, and Product variation.
To test, I created a few variations, but all of them always show up as Default.
modules/commerce/modules/product/src/Entity/ProductVariation.php
I see:
I assume this should be:
Also I see that getTitle() is often used here, but the productvariation does not have this field yet. Still to be implemented or by design?
The above notes and questions are blocking me from working on this ticket, as I cannot get the same behavior as in the TS (Myshirt - blue, small).
Looked at it a bit deeper, and seems that we could do something like this in the productvariation.php inside (public function label() {):
$label = $this->getSku();
instead of:
$label = t('Default')
Comment #3
harings_rob commentedComment #4
harings_rob commentedPull request: https://github.com/drupalcommerce/commerce/pull/313
Comment #6
bojanz commentedhttps://github.com/drupalcommerce/commerce/commit/3b0a9ab32348310d0902f2...
Rebased on https://github.com/drupalcommerce/commerce/commit/bda0e7a08d2747fd82f4cd... and https://github.com/drupalcommerce/commerce/commit/2ecf391572c5ebe48091eb...