digital-downloads

Add programmatically a downloadable file to Woocommerce products

我是研究僧i 提交于 2019-12-11 08:46:16
问题 In my solution I want to automate the product creation as much as possible. One time saver is, in my opinion, to auto add the downloadable file to the product. I have created this function: function fcsp_add_downloadable_file($post_id, $post, $update){ $post_thumbnail_id = get_post_thumbnail_id( $post_id ); $url = get_site_url()."/wp-content/uploads/".get_the_date('Y')."/".get_the_date('m')."/".$filename_only = basename( get_attached_file( $post_thumbnail_id ) ); update_post_meta($post_id, '

Remove product downloads section in woocommerce email notifications

谁说胖子不能爱 提交于 2019-12-11 02:57:38
问题 I would like to remove the download section from the email template that woocommerce will send after my buyer has placed an order. It doesn’t make sense to send the download link to my buyer when their order is still on hold, processing and refunded state. Refer image below: my current email template for on hold status: <?php /** * Customer on-hold order email * * This template can be overridden by copying it to yourtheme/woocommerce/emails/customer-on-hold-order.php. * * HOWEVER, on occasion