• Hi! So, I have a custom code that redirects all non-logged in users that try to buy something of my page to the user-register popup in my site. The condition that triggers this is the woocommerce hook is_checkout(). This is already working for all my paid products, but obviously isn’t with my free downloads, as they skip checkout. So, what I want is to add another condition to that custom code, that enables the redirection to happen also when a non logged in user tries to download a free product. Could you proivide me of a hook I can use for that purpose?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Richard Webster

    (@rwebster85)

    There’s a setting to only show the download button to logged in users, and otherwise display a message on the product page, such as telling them to login or register.

    Is that not easier?

    Thread Starter mxcalderon

    (@mxcalderon)

    Hey! Thanks for the reply. Well I find pasting a hook in a code that’s already there is fairly easy. And yes, what you say would be another way to go and honestly that I didn’t think of. I tried it just now. I’m using the shortcode [download_now id=” “] to display the free download button, and I find that with the “only show to logged in users” option enabled, the message it’s supposed to display instead of the download button isn’t working. It just shows nothing, which is cool as the user won’t be able to download anything, but… there should be some indication there so they know where to go next right? So… do you know any way around this? Or if there’s a hook I could use after all?

    Plugin Author Richard Webster

    (@rwebster85)

    If you’re using the shortcode on what is supposed to be the product page, it’s [download_now_page]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Free download hook’ is closed to new replies.