How to put a date range in a virtual/downloadable product? [closed]

Hook into add_to_cart hook

add_action('woocommerce_add_to_cart', 'create_files_for_cart');

function create_files_for_cart() {
 // Your code that created the file using the dated the user selected

 // More code to add the file created to cart

}

The code to create the downloadable file product is similar to the code in this answer

Add the product to cart with the Cart class functions

You use this plugin to add the date fields to the product.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)