Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Cart
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
12 May 2016 at 12:46 UTC
Updated:
6 Sep 2016 at 00:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nomadkz commentedComment #3
nomadkz commentedup
Comment #4
bojanz commented@nomadkz
Bumping issues like that is extremely frowned upon everywhere on drupal.org.
Feel free to provide a patch, otherwise you'll need to wait when another contributor has free time to address this.
Comment #5
nomadkz commented@bojanz
OK.
Comment #6
Sonal.Sangale commentedComment #7
Sonal.Sangale commentedComment #8
pieterjanput commentedComment #9
pieterjanput commentedQuantities can now be set for singular and plural. For translation of these setting you can use Configuration Translation.
https://github.com/drupalcommerce/commerce/pull/416
Comment #10
mglamanCan we have tests added to verify this works? Should be a Functional test. If you're unfamiliar, please see my recent blog post: https://drupalcommerce.org/blog/45322/commerce-2x-unit-kernel-and-functi.... We have plenty of code examples :)
Comment #11
mglamanComment #12
mglamanHere is the
initialoriginal patch.Comment #13
mglamanNew PR with tests: https://github.com/drupalcommerce/commerce/pull/448
Comment #14
bojanz commentedI've looked into the patch, and it's complex, both UX and DX wise.
I see that it's copied from core (NumberField?), where there's a similar need.
However, there's no API defined for this, and the original implementation is already criticized for being hard to understand: #2499639: Use correct labels for numeric fields when using a multiple plural forms language.
So I think the better solution is to simply remove the setting in question, and to pass the variable to the template after running formatPlural() ourselves. The few people who wish to override item/items will be able to write a preprocess template hook, and do their own formatPlural() line inside.
Commit incoming as soon as it passes tests.
Comment #16
bojanz commentedDone. Thanks, everyone.
Comment #17
ndf commentedNice testCountText()