2012-11-27 16:22:47 +00:00
|
|
|
<?php
|
2014-09-20 20:05:06 +00:00
|
|
|
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
|
|
exit; // Exit if accessed directly
|
|
|
|
}
|
|
|
|
|
2012-10-16 09:11:50 +00:00
|
|
|
?>
|
|
|
|
<div class="wc-metabox closed">
|
|
|
|
<h3 class="fixed">
|
2016-07-14 13:54:28 +00:00
|
|
|
<button type="button" data-permission_id="<?php echo absint( $download->permission_id ); ?>" rel="<?php echo absint( $download->product_id ) . ',' . esc_attr( $download->download_id ); ?>" class="revoke_access button"><?php _e( 'Revoke Access', 'woocommerce' ); ?></button>
|
2015-08-05 18:08:15 +00:00
|
|
|
<div class="handlediv" title="<?php esc_attr_e( 'Click to toggle', 'woocommerce' ); ?>"></div>
|
2012-10-16 09:11:50 +00:00
|
|
|
<strong>
|
2016-09-02 01:33:57 +00:00
|
|
|
<?php echo '#' . absint( $product->id ) . ' — ' . apply_filters( 'woocommerce_admin_download_permissions_title', $product->get_title(), $download->product_id, $download->order_id, $download->order_key, $download->download_id ) . ' — ' . esc_html( $file_count ) . ': ' . wc_get_filename_from_url( $product->get_file_download_path( $download->download_id ) ) . ' — ' . sprintf( _n( 'Downloaded %s time', 'Downloaded %s times', absint( $download->download_count ), 'woocommerce' ), absint( $download->download_count ) ); ?>
|
2012-10-16 09:11:50 +00:00
|
|
|
</strong>
|
|
|
|
</h3>
|
|
|
|
<table cellpadding="0" cellspacing="0" class="wc-metabox-content">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>
|
2016-03-10 11:39:32 +00:00
|
|
|
<label><?php _e( 'Downloads remaining', 'woocommerce' ); ?></label>
|
2012-10-16 09:11:50 +00:00
|
|
|
<input type="hidden" name="product_id[<?php echo $loop; ?>]" value="<?php echo absint( $download->product_id ); ?>" />
|
|
|
|
<input type="hidden" name="download_id[<?php echo $loop; ?>]" value="<?php echo esc_attr( $download->download_id ); ?>" />
|
2015-08-05 18:08:15 +00:00
|
|
|
<input type="number" step="1" min="0" class="short" name="downloads_remaining[<?php echo $loop; ?>]" value="<?php echo esc_attr( $download->downloads_remaining ); ?>" placeholder="<?php esc_attr_e( 'Unlimited', 'woocommerce' ); ?>" />
|
2012-10-16 09:11:50 +00:00
|
|
|
</td>
|
|
|
|
<td>
|
2016-03-10 11:39:32 +00:00
|
|
|
<label><?php _e( 'Access expires', 'woocommerce' ); ?></label>
|
2015-08-05 18:08:15 +00:00
|
|
|
<input type="text" class="short date-picker" name="access_expires[<?php echo $loop; ?>]" value="<?php echo $download->access_expires > 0 ? date_i18n( 'Y-m-d', strtotime( $download->access_expires ) ) : ''; ?>" maxlength="10" placeholder="<?php esc_attr_e( 'Never', 'woocommerce' ); ?>" pattern="[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01])" />
|
2012-10-16 09:11:50 +00:00
|
|
|
</td>
|
2016-05-11 04:52:18 +00:00
|
|
|
<td>
|
|
|
|
<label><?php _e( 'Customer download link', 'woocommerce' ); ?></label>
|
|
|
|
<?php
|
2016-08-27 06:14:06 +00:00
|
|
|
$download_link = add_query_arg( array(
|
2016-05-11 04:52:18 +00:00
|
|
|
'download_file' => $download->product_id,
|
|
|
|
'order' => $download->order_key,
|
|
|
|
'email' => urlencode( $download->user_email ),
|
2016-08-27 01:46:45 +00:00
|
|
|
'key' => $download->download_id,
|
2016-05-11 04:52:18 +00:00
|
|
|
), trailingslashit( home_url() ) );
|
|
|
|
|
2016-05-11 09:58:04 +00:00
|
|
|
echo '<a href="' . esc_url( $download_link ) . '">' . esc_html( $file_count ) . '</a>';
|
2016-05-11 04:52:18 +00:00
|
|
|
?>
|
|
|
|
</td>
|
2012-10-16 09:11:50 +00:00
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2014-09-20 20:05:06 +00:00
|
|
|
</div>
|