Simon Crone

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
in reply to: Free download but with license key. #194150

Simon Crone
Participant

Almost there!

This is what I have done.

1. I have a package that only allows access for “subscriber” role (package id of 123).
2. If no user is logged in then download button is set to “Register to Unlock” as the “Login Required Message” (under Settings->General) is set to:

<a href="https://mysite.com/wp-login.php?action=register">Register to Unlock"</a>

3. Once registered, the user is assigned the “customer role” by default.
4. Since the user role is not “subscriber” the download button now shows “Generate Key” as the “Permission Denied Message for Packages” (under Settings->General) is set to:

<a href="https://mysite.com/?add_to_cart=123">Generate Key</a>

5. The cart is shown with the added package and the user can then complete the order ($0 cost)
6. The license key is generated and the user role “subscriber” is added to the user.
7. Thus the download button from now on allows direct download to the package.

Works well….

The only drawback is that if I am to create a second package for download with the need for a different license key, then the user is already assigned the “subscriber” role so the download button will bypass the purchase order process. I will have to create a custom role for each package.

Hope this is useful for someone.

in reply to: Show license key in purchase conformation email? #194083

Simon Crone
Participant
This reply has been marked as private.
in reply to: Free download but with license key. #193468

Simon Crone
Participant

Nayeem,

I have only got it partially to work.

This works:
If the user is not logged in, then the “add_to_cart” button works and the user is taken to the cart.
There they can login (or register), the discount is applied and the complete payment button shows which they click.
The license is then generated and they are taken to the purchased page and see the order and newly generated license key.

However this doesn’t work:
If the user has registered and logged in then there is no way of adding the package to the cart to purchase it as the add to cart button has been turned into a direct download button. thus it downloads the package without generating a license key.

I realise that a logged on user doesn’t need to generate a new key every time the redownload the package.
Is there a way to check if a package has been purchased before it is downloaded?

Simon.

The. issue is that the license key is only generated when processing checkout.
If a customer is logged in then

in reply to: Free download but with license key. #193424

Simon Crone
Participant

Thanks I’ll give it a try and get back to you.

Viewing 4 posts - 1 through 4 (of 4 total)