Closed (duplicate)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Product
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Nov 2017 at 18:02 UTC
Updated:
25 Sep 2019 at 23:18 UTC
Jump to comment: Most recent
Comments
Comment #2
mglamanBut the title isn't generated? You are manually setting it. I'm not sure I follow.
Is the problem here the fact core's token support is lacking, and we do not have token as a dependency - thus hindering "Here, override the normal generation logic with these token based values"
Comment #3
mglamanI *think* this would be solved by #2923854: Start depending on Token and allowing a custom input for changing the way a variation's title is generated.
Comment #4
mrpauldriver commentedI don't think this is a token issue, because the information required already belongs to commerce. Please excuse my of use of square brackets if this has confused things.
To quote from issue/2923854 which you reference;
I am simply asking for hardcoding of Product Name - Variation Title; to be displayed where 'Generate variation titles based on attribute values' is NOT enabled.
I ask this because Commerce already requires manual completion of a Variation Title field, if variation title generation is not enabled. But the full product title does not find it's way to the cart and order views.
Please allow me the following example.
Product Name: My Unique Book Title
Variation One: September 2014 Edition
Variation Two: October 2017 Edition
Assuming that an 'order item type' is configured to display the purchased entity as 'product vatiation title' AND if the editor does not want to create attributes for their unique product, the purchased entity will display only as September 2014 Edition in the cart and order views, with no mention of the parent product title. It should of course display as 'My Unique Book Title - September 2014 Edition'.
In situations where a product's variations are unique to the product itself, it is unreasonable to require the creation of an attribute set, in addition to, and before, the variations are created. The variation title should be enough and I have heard Ryan describe this as a 'classic variation'
This UX has flaws and the strict workflow is somewhat the same as requiring an editor to create a product before creating a product display.
This is my first outing with Commerce 2, and I have spent several days trying to resolve this matter; thinking it must be a bug, only to realise that this feature actually works as intended. Please consider improving it.
Comment #5
mglamanSo, without variation title generation you'd still like the variation label to include the product's title - not just the variation's title. Without having to update views and such to include the product title.
Comment #6
mglamanMoving to active. Would a "Prepend product title" type setting resolve this? It again comes to the whole generated title item and providing options on what exactly a generated title is.
Comment #7
mrpauldriver commentedYes and Yes. And yes please.
Comment #8
mglamanThanks for helping clarify the request. Would it be best to:
using token/twig replacements.
Thoughts? I feel option #1 would be best, but I'm assuming you may be using attributes?
Comment #9
mrpauldriver commentedThank you for considering the request.
Option one would completely satisfy the use case of a variation with no attributes. I also think commerce should work like this out of the box.
Option two, sounds like a separate module, similar to Automatic Entity Label.
Comment #10
mrpauldriver commentedTo be clear.
- If using attributes, the variation label should be 'Product Title - Attribute Title'
- If NOT using attributes, the variation label should be 'Product Title - Variation Title'
This methodology fits with 'order item types', where the purchased entity widget can be configured to display 'product attribute title' or 'product variation title'.
If you wanted to nail the UX, each of these variation label types would be automatically paired with a compatible 'order item type'.
Suggest that custom labelling of variations should handled by contrib, or a combination of token and twig.
Comment #11
mglamanCool! I wasn't sure if you were using attributes and still wanted it customized. I think this is a far enough thing to work on. My time is currently tied up in roadmap work, but I'll keep it as a good issue for people to work on.
Comment #12
mrpauldriver commentedThank you. Please let me know if you need anything testing.
Comment #13
Alexandre360 commented+1, by waiting a fix to this, how can you get the product title in commerce-product-variation.html.twig ?
Comment #14
geek-merlinComment #15
bbuchert commentedThis might also be helpful if you want certain attributes excluded form the variation title.
Not sure if what I did is not a good idea, but I added an attribute processing time into the product variation which I would not want inside the variation title. Being able to set the variation titles via tokens. Would give a lot of flexibillity.
Comment #16
bbuchert commentedComment #17
bojanz commentedLet's continue in #3083745: Rework product variation label handling, which tries to write down all of the intersecting use cases.