WC_Emails::order_downloads()
Show order downloads in a table.
Method of the class: WC_Emails{}
Hooks from the method
Return
null
. Nothing (null).
Usage
$WC_Emails = new WC_Emails(); $WC_Emails->order_downloads( $order, $sent_to_admin, $plain_text, $email );
- $order(WC_Order) (required)
- Order instance.
- $sent_to_admin(true|false)
- If should sent to admin.
Default: false - $plain_text(true|false)
- If is plain text email.
Default: false - $email(string)
- Email address.
Default: ''
Changelog
Since 3.2.0 | Introduced. |
WC_Emails::order_downloads() WC Emails::order downloads code WC 9.3.1
public function order_downloads( $order, $sent_to_admin = false, $plain_text = false, $email = '' ) { $show_downloads = $order->has_downloadable_item() && $order->is_download_permitted() && ! $sent_to_admin && ! is_a( $email, 'WC_Email_Customer_Refunded_Order' ); if ( ! $show_downloads ) { return; } $downloads = $order->get_downloadable_items(); $columns = apply_filters( 'woocommerce_email_downloads_columns', array( 'download-product' => __( 'Product', 'woocommerce' ), 'download-expires' => __( 'Expires', 'woocommerce' ), 'download-file' => __( 'Download', 'woocommerce' ), ) ); if ( $plain_text ) { wc_get_template( 'emails/plain/email-downloads.php', array( 'order' => $order, 'sent_to_admin' => $sent_to_admin, 'plain_text' => $plain_text, 'email' => $email, 'downloads' => $downloads, 'columns' => $columns, ) ); } else { wc_get_template( 'emails/email-downloads.php', array( 'order' => $order, 'sent_to_admin' => $sent_to_admin, 'plain_text' => $plain_text, 'email' => $email, 'downloads' => $downloads, 'columns' => $columns, ) ); } }