I am in a situation. I have a downloadable product, with over 3500 customers buying it so far. While updating the downloadable product, apparently I messed up and some how removed access to the current 3500+ clients resulting in many confused emails. The customers are still shown as buying the digital product in their account purchases.
So that brings me to desperately ask, how do I bulk generate/grant download permissions on WooCommerce to the customers that have already bought my downloadable product?
I’m thinking about a SQL query, but not exactly sure what I would need to move and to where? What makes it even more difficult is I only need the permissions to be granted to customers of the specific product!
I came up with the following solution. You can place this code to
functions.php
, open any page in backend or frontend (to run functions.php) and then comment or delete this code. It will not affect orders which already have download permissions.@Tyree B. Hope you have resolved the issue, if yes then please share here else you can follow below solution:
Loop through your all users and get their order (order no.) and add the new downloadable product in the existing order using wc_add_order_item woocommerce function (You will also need to add product meta like quantity, priduct id etc.)
Loop through all customers and create a new order (gift order using code) for each customer and add product to the order. As per woocommerce rule/functionality automatically all user can download product from their my-account under download link.
Hopes it will help you.
There are a plugin Booster for Woocommerce (https://booster.io/features/woocommerce-orders/) that have a “Regenerate bulk permission download” option, u can activate manually our periodically