Hello fellow Commercistas,
I need to sell file access for non-premium users but show file downloads for premium users.
As far as I understand I can either choose to use the "Add to cart" field formatter or the "Rendered product", but I haven't found a way to display either one depending on user role or permission. It would also be nice to show a direct download link for authenticated non-premium users that already have bought a file license.
How could that be done? Do I need to write my own field formatter or is there a better way to achieve it?
Thanks a lot
PS: found this related issue #1266132: Add to Cart OR Show files formatter that is quite old and only about part two. But it seems there's no way around coding my own field formatter, right?
Comments
Comment #2
daniel wentsch commentedComment #3
daniel wentsch commentedComment #4
daniel wentsch commentedHalf a year later I stumbled across the same issue and somehow managed to make my own formatter that works the way I want:
Show a Download link for users who have bought a file or have permission to bypass and show a add-to-cart form for everybody else.
For future reference here's the code:
https://gist.github.com/klickreflex/f917479dca40211a7624962cf76efaa8
Comment #5
damienmckenna