挂钩到add\\u to\\u cart挂钩
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
}
创建可下载文件产品的代码与中的代码类似
this answer使用将产品添加到购物车Cart class 功能
您使用this plugin 将日期字段添加到产品。