I've set up a Drupal Commerce store (on localhost) for a book shop. One of the requirements is that people can buy ebooks without creating an account.
It all works fine if I buy a book as the administrator; at the end of the checkout process I can download the book. However, when I buy a book as an anonymous user I'm shown the 'Download now' link in plain text.
I'm using a content type named 'Books' with a field named 'Ebooks'. The latter uses the 'File' field type. The rest of my set-up is as follows:
Commerce File 7.x-2.0-beta2:
- Product types: Books
- Download limits: 5
Commerce License 7.x-1.2
- Product types: Books
- Line item types: Product
Permissions for anonymous users:
- Checkout, Access checkout
- Commerce licenses, View own licenses
- Order, View own orders of any type
Rules:
- Create a new account for an anonymous order: inactive
- Assign an anonymous order to a pre-existing user: inactive
- Activates licenses of an order: Completing the checkout process > Activates all licenses of the provided order
- Update the order status on checkout completion: Completing the checkout process > Update the order state (to 'Pending')
At first I though the issue was that the order status is changed to 'Pending' once the checkout process has completed. However, changing this made no difference.
I then found that giving anonymous users permission to 'bypass license control' does instantly resolve the issue. However, that permission setting comes with a "give to trusted roles only; this permission has security implications".
So... something is not quite right in my set-up. It seems that anonymous users aren't given a license allowing them to download their purchase. I've run out of ideas though. What have I done wrong?