Hi,
I'm going crazy!
I need to sell online "audio books" on my website. So, if an user buys an audiobook it assumes a specific role that, for clarity, is the name of this book. When he assumes this role, he can read chapters of this book.
All works, but the "add to cart" button in product page is always visible, even if this user bought the product.
I want to disable this button if the user has already bouht the book, it's simple, but I'm unable to do this.
Help please!

Comments

germanocarella created an issue.

Cayenne’s picture

Two ways to do this in D7, I think.

1. Use panels and have the add to cart form appear in a panel that is hidden when that particular class of user is logged in or

2. a small custom module that makes use of hook_form_alter to hide or unset the bit of code that translates to the "add to cart" form.