Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Product
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jun 2018 at 14:24 UTC
Updated:
25 Oct 2019 at 10:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
zenimagine commentedComment #3
zenimagine commentedWhen "Product variation title" is selected in
/admin/commerce/config/order-item-types/produit/edit/form-display/add_to_cartand if there is only one variation, it will not is not displayed on the product page.When "Product variation attributs" is selected in
/admin/commerce/config/order-item-types/produit/edit/form-display/add_to_cartand if there is only one variation, it is displayed on the product page.How to display the variation even if it has only one with "Product variation title"?
Comment #4
zenimagine commentedComment #5
zenimagine commentedComment #6
zenimagine commentedDoes anyone have a solution for this problem ?
Comment #7
captaindav commentedComment #8
captaindav commentedPer 8/28 Skype discussion with bojanz, he stated the existing code in ProductVariationTitleWidget.php checks to see if there is only one variation, and if there is, the variation title is omitted. The code is located in lines 84-92 of ProductVariationtitleWidget.php. I verified that commenting out those lines of code, then clearing the cache, has the desired result. bojanz agreed that it would be desirable to have this configurable, so I will create a patch that makes a configuration setting for this at some point in the future. Until then I have created a temporary patch that I am applying with composer that simply deletes lines 84-92.
Comment #9
captaindav commentedComment #10
czigor commentedTests are still needed.
Comment #11
czigor commentedLet's see what the testbot says.
Comment #13
czigor commentedAdding schema.
Comment #14
czigor commentedComment #15
zenimagine commented@czigor Hi thanks for the patch, where should we set ?
Comment #16
czigor commentedIn the order item type's "Add to cart" form display mode.
Comment #17
zenimagine commented@czigor sorry I do not see the parameter
Comment #18
zenimagine commented@czigor Ok sorry I made a mistake. The patch works and the variation appears :-)
Comment #19
czigor commentedGreat, thanks for testing!
Comment #20
bojanz commentedTweaked the setting name since we already use hide_single in multiple places.
We are missing test coverage, but it looks like the entire widget has very low test coverage, so we'll have to fix it in a followup.
Comment #21
bojanz commentedCommitted.