• Resolved Brian Daley

    (@bdaley)


    Hi!

    I’ve noticed that using “Order -> Order Actions -> Regenerate Download Permissions” will only reset the value in “Downloads Remaining” but does not extend the value for “Access Expires.”

    For example, take a downloadable order with the following properties:

    Downloads Remaining: 0
    Access Expires: 2017-12-22

    After running “Regenerate Download Permissions” we have:

    Downloads Remaining: 3 (reset properly)
    Access Expires: 2017-12-22 (untouched)

    In this case, the user still cannot download the file, since the access expiry date is unchanged and in the past.

    Which brings me to my questions:
    1) Is this the intended functionality? (If not, I’m happy to submit a formal bug report)
    2) If yes, is there a setting or programmatic method for ALSO resetting the access expiry to a point in the future.

    Much thanks!

    -Brian

Viewing 5 replies - 1 through 5 (of 5 total)
  • dougaitken

    (@dougaitken)

    Automattic Happiness Engineer

    Hi there @bdaley

    Yes, this is intended behaviour – there isn’t a part of this which a date can be set.

    You can amend the download expiry within the order – you can see this area here -https://docs.woocommerce.com/document/digital-downloadable-product-handling/

    I hope this helps, have a great day!

    Thanks,

    Thread Starter Brian Daley

    (@bdaley)

    Thanks for the reply.

    For my use-case, it’s necessary to also reset the the download expiration date (today + 5 days). Which means that regenerating download permissions becomes a 2-step process.

    I’d like to automate this process so I don’t need to reset the download number AND the date. Before I embark on writing a custom solution to handle this, I’m just wondering: do you see any reason why I shouldn’t write an extension to handle this for me? (i.e., it would break something else in WooCommerce)

    Thanks!

    Thread Starter Brian Daley

    (@bdaley)

    In case anybody else encounters this issue, I’ve created a gist with my solution.

    Regenerate Permissions/Expiration and Notify User

    By default, my code extends the expiration date indefinitely. But I’m sure this could be modified to use the product default expiration.

    Todd

    (@toddneufeld)

    Thanks! This is super-helpful.

    Thank you Brian. Your modification was just what needed!

    Automattic: Wouldn’t be better if this was core behaviour?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘“Regenerate Download Permissions” doesn’t reset expiration date’ is closed to new replies.