html-order-download-permission.php
6 years ago
html-order-fee.php
3 months ago
html-order-item-meta.php
4 years ago
html-order-item.php
9 months ago
html-order-items.php
1 month ago
html-order-notes.php
1 month ago
html-order-refund.php
3 months ago
html-order-shipping.php
3 months ago
html-product-attribute-inner.php
1 month ago
html-product-attribute.php
3 years ago
html-product-data-advanced.php
6 months ago
html-product-data-attributes.php
1 month ago
html-product-data-general.php
2 months ago
html-product-data-inventory.php
4 months ago
html-product-data-linked-products.php
3 months ago
html-product-data-panel.php
1 year ago
html-product-data-shipping.php
3 years ago
html-product-data-variations.php
1 month ago
html-product-download.php
4 months ago
html-product-variation-download.php
4 months ago
html-variation-admin.php
1 month ago
html-order-download-permission.php
67 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | exit; |
| 4 | } |
| 5 | ?> |
| 6 | <div class="wc-metabox closed"> |
| 7 | <h3 class="fixed"> |
| 8 | <button type="button" data-permission_id="<?php echo esc_attr( $download->get_id() ); ?>" rel="<?php echo esc_attr( $download->get_product_id() ) . ',' . esc_attr( $download->get_download_id() ); ?>" class="revoke_access button"><?php esc_html_e( 'Revoke access', 'woocommerce' ); ?></button> |
| 9 | <div class="handlediv" aria-label="<?php esc_attr_e( 'Click to toggle', 'woocommerce' ); ?>"></div> |
| 10 | <strong> |
| 11 | <?php |
| 12 | printf( |
| 13 | '#%s — %s — %s: %s — ', |
| 14 | esc_html( $product->get_id() ), |
| 15 | esc_html( apply_filters( 'woocommerce_admin_download_permissions_title', $product->get_name(), $download->get_product_id(), $download->get_order_id(), $download->get_order_key(), $download->get_download_id() ) ), |
| 16 | esc_html( $file_count ), |
| 17 | esc_html( wc_get_filename_from_url( $product->get_file_download_path( $download->get_download_id() ) ) ) |
| 18 | ); |
| 19 | printf( _n( 'Downloaded %s time', 'Downloaded %s times', $download->get_download_count(), 'woocommerce' ), esc_html( $download->get_download_count() ) ) |
| 20 | ?> |
| 21 | </strong> |
| 22 | </h3> |
| 23 | <table cellpadding="0" cellspacing="0" class="wc-metabox-content"> |
| 24 | <tbody> |
| 25 | <tr> |
| 26 | <td> |
| 27 | <label><?php esc_html_e( 'Downloads remaining', 'woocommerce' ); ?></label> |
| 28 | <input type="hidden" name="permission_id[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $download->get_id() ); ?>" /> |
| 29 | <input type="number" step="1" min="0" class="short" name="downloads_remaining[<?php echo esc_attr( $loop ); ?>]" value="<?php echo esc_attr( $download->get_downloads_remaining() ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'woocommerce' ); ?>" /> |
| 30 | </td> |
| 31 | <td> |
| 32 | <label><?php esc_html_e( 'Access expires', 'woocommerce' ); ?></label> |
| 33 | <input type="text" class="short date-picker" name="access_expires[<?php echo esc_attr( $loop ); ?>]" value="<?php echo ! is_null( $download->get_access_expires() ) ? esc_attr( date_i18n( 'Y-m-d', $download->get_access_expires()->getTimestamp() ) ) : ''; ?>" maxlength="10" placeholder="<?php esc_attr_e( 'Never', 'woocommerce' ); ?>" pattern="<?php echo esc_attr( apply_filters( 'woocommerce_date_input_html_pattern', '[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])' ) ); ?>" /> |
| 34 | </td> |
| 35 | <td> |
| 36 | <label><?php esc_html_e( 'Customer download link', 'woocommerce' ); ?></label> |
| 37 | <?php |
| 38 | $download_link = add_query_arg( |
| 39 | array( |
| 40 | 'download_file' => $download->get_product_id(), |
| 41 | 'order' => $download->get_order_key(), |
| 42 | 'email' => urlencode( $download->get_user_email() ), |
| 43 | 'key' => $download->get_download_id(), |
| 44 | ), |
| 45 | trailingslashit( home_url() ) |
| 46 | ); |
| 47 | ?> |
| 48 | <a id="copy-download-link" class="button" href="<?php echo esc_url( $download_link ); ?>" data-tip="<?php esc_attr_e( 'Copied!', 'woocommerce' ); ?>" data-tip-failed="<?php esc_attr_e( 'Copying to clipboard failed. You should be able to right-click the button and copy.', 'woocommerce' ); ?>"><?php esc_html_e( 'Copy link', 'woocommerce' ); ?></a> |
| 49 | </td> |
| 50 | <td> |
| 51 | <label><?php esc_html_e( 'Customer download log', 'woocommerce' ); ?></label> |
| 52 | <?php |
| 53 | $report_url = add_query_arg( |
| 54 | 'permission_id', |
| 55 | rawurlencode( $download->get_id() ), |
| 56 | admin_url( 'admin.php?page=wc-reports&tab=orders&report=downloads' ) |
| 57 | ); |
| 58 | echo '<a class="button" href="' . esc_url( $report_url ) . '">'; |
| 59 | esc_html_e( 'View report', 'woocommerce' ); |
| 60 | echo '</a>'; |
| 61 | ?> |
| 62 | </td> |
| 63 | </tr> |
| 64 | </tbody> |
| 65 | </table> |
| 66 | </div> |
| 67 |