• Resolved lsingh

    (@lsingh)


    Hi,

    Just looking for a code to set a default limit of all downloadable products.

    Users could download a single product only 5 times not more than that.

    Thanks
    Lokendra

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @lsingh ,

    It looks like there are no hooks available to modify this default behavior.

    This is defined where WC_Product extends WC_Abstract_Legacy_Product. You will see a data array with an item like this – 'download_limit' => -1,.

    You can look at our code reference for get_download_limit() and get_download_expiry() details.

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    If you need a paid solution, you can consider taking help from one of our partner’s website.

    Thank you ??

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

    @lsingh did you ever find a solution for this? Like you I am trying to set a default download limit so it isn’t forgotten when adding new products. I’m astounded there isn’t an option for this under WooCommerce -> Settings -> Products -> Downloadable Products.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to set the download limit as default for all downloadable products?’ is closed to new replies.