WC_Emails::order_downloads( WC_Order $order, bool $sent_to_admin = false, bool $plain_text = false, string $email = '' )
Show order downloads in a table.
Description Description
Parameters Parameters
- $order
-
(Required) Order instance.
- $sent_to_admin
-
(Optional) If should sent to admin.
Default value: false
- $plain_text
-
(Optional) If is plain text email.
Default value: false
-
(Optional) Email address.
Default value: ''
Source Source
File: includes/class-wc-emails.php
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 | 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 , ) ); } } |
Changelog Changelog
Version | Description |
---|---|
3.2.0 | Introduced. |