h2. Issue description
The SimpleStockLevelFormatter has stopped working. Looks like the issue is as a result of an empty array $items passed in to the function. probably related to changes in the calculated field and needs investigation.
h2. Original issue report
The stock field is visible in "product variations, manage form display"
The stock field is active in "product variations, manage display" but the product variation does not show this on the view page.
I can to create a view with stock, but the there is no relationship with commerce products available.
Creating a view for e-commerce products there is a field stock but does not show values.
Here there is no method to add a stock relationship, nothing shows up in relationships.
How should the stock level be made visible on a product page and in views? I have
I use the the up to date modules (as found on 1 dec 2017).
Comments
Comment #2
Cheviot commentedComment #3
guy_schneerson commentedComment #4
guy_schneerson commentedThanks Cheviot for reporting
Comment #5
guy_schneerson commentedComment #7
guy_schneerson commentedThe issue was that Drupal 8 computed field support was not complete and it ended up storing values in the database and $items in viewElements() was not empty.
I suspect that it no longer stores the values and we can now ignore the empty$items return a single element, holding the stock level.