When i create a content with Goal, the progressionbar is ok and grows up when i pay. But when i want to create a view or panel with this field, i can't link the Goal progress bar to a product.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | commerce_goal-views_support-2162651-8.patch | 2.09 KB | zengenuity |
| #3 | views_support.patch | 1.58 KB | Renee S |
Comments
Comment #1
zengenuity commentedThere isn't currently a Views field handler that displays the progress bar. To work around this, you could switch the view from from displaying Fields to Content, and then choose Teaser or some other view mode where the progress bar is present. You can create custom view modes using Display Suite, if needed.
Comment #2
topcweb commentedYou can use display suite which you can then create a content type grid to gain control over the teaser display.
Comment #3
Renee S commentedI've added in this functionality in the simplest way possible:
- I have the formatter check to see if we're in a view with fields
- If we're in a view, pick up the product settings from the default field settings
- Unset the formatter's commerce product picker, because we aren't using it for the view
This would require the module to depend on the wee helper-module "field_formatter_settings" which adds a hook that didn't make it into core that allows us to intercept formatters.
Comment #4
Renee S commentedComment #5
zengenuity commentedDo we actually need to make field_formatter_settings a dependency? It seems like we can just make it optional for people who want to use this with views fields and panels. We can add a note in the README and on the module page about it.
Second thing: I haven't had time to test this yet, but this code looks like it would break the existing functionality of the module, wouldn't it?
I haven't used field_formatter_settings before, so I could be missing something, but shouldn't there be a check there to determine if we're actually in a panels or views field context?
Comment #6
Renee S commentedhahahaha oh my goodness yes, lol, it totally does break the original formatter too. I will just toddle off and add that check. Thanks ;)
Comment #7
Renee S commentedSo, this does the trick:
Though if we're considering expanding it to panels, maybe it's better to check for the "_custom" view mode?
Comment #8
zengenuity commentedOkay, I spent some time looking at this today, and I decided to redo this patch in a different way. Rather than getting the default value (which doesn't always work), I'm checking to see if we're in an actual entity/bundle context, and if not, then pulling all the product reference fields from all the bundles that this field is assigned to. This makes the form work like it does on the Manage Display page. (except that it may have more options if the field is used on multiple content types)
I tested this with Views fields and it works. I'm not sure what people are doing with Panels exactly, so I'm not sure what to test. I suspect it may work with Panels, though, as well.
@Renee_S (and anyone else following this issue), please test the attached patch and let me know if it works. You'll need to back out your other patch. This patch does not require field_formatter_settings module.
Comment #9
Renee S commentedYes, zengenuity, this worked for me in Views, and in Panels (adding it as a field.)
Comment #11
zengenuity commentedCommitted this patch. Will roll a new stable release momentarily.