installed plugin Easy Digital Downloads version 3.1.0.3

This commit is contained in:
2022-11-27 15:03:07 +00:00
committed by Gitium
parent 555673545b
commit c5dce2cec6
1200 changed files with 238970 additions and 0 deletions

View File

@ -0,0 +1,106 @@
<?php
/**
* Displays a list of notifications.
*
* @package easy-digital-downloads
* @copyright Copyright (c) 2021, Easy Digital Downloads
* @license GPL2+
* @since 2.11.4
*/
?>
<div
id="edd-notifications"
class="edd-hidden"
x-data
x-init="function() { $el.classList.remove( 'edd-hidden' ) }"
>
<div
class="edd-overlay"
x-show="$store.eddNotifications.isPanelOpen"
x-on:click="$store.eddNotifications.closePanel()"
></div>
<div
id="edd-notifications-panel"
x-show="$store.eddNotifications.isPanelOpen"
x-transition:enter-start="edd-slide-in"
x-transition:leave-end="edd-slide-in"
>
<div id="edd-notifications-header" tabindex="-1">
<h3>
<?php
echo wp_kses(
sprintf(
/* Translators: %s - number of notifications */
__( '(%s) New Notifications', 'easy-digital-downloads' ),
'<span x-text="$store.eddNotifications.numberActiveNotifications"></span>'
),
array( 'span' => array( 'x-text' => true ) )
);
?>
</h3>
<button
type="button"
class="edd-close"
x-on:click="$store.eddNotifications.closePanel()"
>
<span class="dashicons dashicons-no-alt"></span>
<span class="screen-reader-text"><?php esc_html_e( 'Close panel', 'easy-digital-downloads' ); ?></span>
</button>
</div>
<div id="edd-notifications-body">
<template x-if="$store.eddNotifications.notificationsLoaded && $store.eddNotifications.activeNotifications.length">
<template x-for="(notification, index) in $store.eddNotifications.activeNotifications" :key="notification.id">
<div class="edd-notification">
<div class="edd-notification--icon" :class="'edd-notification--icon-' + notification.type">
<span class="dashicons" :class="'dashicons-' + notification.icon_name"></span>
</div>
<div class="edd-notification--body">
<div class="edd-notification--header">
<h4 class="edd-notification--title" x-text="notification.title"></h4>
<div class="edd-notification--date" x-text="notification.relative_date"></div>
</div>
<div class="edd-notification--content" x-html="notification.content"></div>
<div class="edd-notification--actions">
<template x-for="button in notification.buttons">
<a
:href="button.url"
:class="button.type === 'primary' ? 'button button-primary' : 'button button-secondary'"
target="_blank"
x-text="button.text"
></a>
</template>
<button
type="button"
class="edd-notification--dismiss"
x-on:click="$store.eddNotifications.dismiss( $event, index )"
>
<?php esc_html_e( 'Dismiss', 'easy-digital-downloads' ); ?>
</button>
</div>
</div>
</div>
</template>
</template>
<template x-if="$store.eddNotifications.notificationsLoaded && ! $store.eddNotifications.activeNotifications.length">
<div id="edd-notifications-none">
<?php esc_html_e( 'You have no new notifications.', 'easy-digital-downloads' ); ?>
</div>
</template>
<template x-if="! $store.eddNotifications.notificationsLoaded">
<div>
<?php esc_html_e( 'Loading notifications...', 'easy-digital-downloads' ); ?>
</div>
</template>
</div>
</div>
</div>

View File

@ -0,0 +1,71 @@
<?php
/**
* Order Overview: Actions
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$is_refundable = edd_is_order_refundable( $order->id );
$is_override = edd_is_order_refundable_by_override( $order->id );
$is_window_passed = edd_is_order_refund_window_passed( $order->id );
if ( true === edd_is_add_order_page() ) :
?>
<button
id="add-adjustment"
class="button button-secondary"
>
<?php echo esc_html_x( 'Add Adjustment', 'Apply an adjustment to an order', 'easy-digital-downloads' ); ?>
</button>
<?php if ( true === edd_has_active_discounts() ) : ?>
<button
id="add-discount"
class="button button-secondary"
>
<?php echo esc_html_x( 'Add Discount', 'Apply a discount to an order', 'easy-digital-downloads' ); ?>
</button>
<?php endif; ?>
<button
id="add-item"
class="button button-secondary"
autofocus
>
<?php echo esc_html( sprintf( __( 'Add %s', 'easy-digital-downloads' ), edd_get_label_singular() ) ); ?>
</button>
<?php elseif ( 'refunded' !== $order->status && edd_get_order_total( $order->id ) > 0 ) : ?>
<div class="edd-order-overview-actions__locked">
<?php esc_html_e( 'Order items cannot be modified.', 'easy-digital-downloads' ); ?>
<span alt="f223" class="edd-help-tip dashicons dashicons-editor-help" title="<?php esc_attr_e( 'Issue a refund to adjust the net total for this order.', 'easy-digital-downloads' ); ?>"></span>
</div>
<div class="edd-order-overview-actions__refund">
<?php if ( 'amazon' === $order->gateway ) : ?>
<span class="dashicons dashicons-lock" title="<?php esc_attr_e( 'Amazon orders must be refunded at the gateway.', 'easy-digital-downloads' ); ?>"></span>
<?php elseif ( true === $is_refundable && true === $is_override && true === $is_window_passed ) : ?>
<span class="edd-help-tip dashicons dashicons-unlock" title="<?php esc_attr_e( 'The refund window for this Order has passed; however, you have the ability to override this.', 'easy-digital-downloads' ); ?>"></span>
<?php elseif ( false === $is_refundable && true === $is_window_passed ) : ?>
<span class="edd-help-tip dashicons dashicons-lock" title="<?php esc_attr_e( 'The refund window for this Order has passed.', 'easy-digital-downloads' ); ?>"></span>
<?php endif; ?>
<button
id="refund"
class="button button-secondary edd-refund-order"
<?php if ( false === $is_refundable && false === $is_override ) : ?>
disabled
<?php endif; ?>
>
<?php esc_html_e( 'Initialize Refund', 'easy-digital-downloads' ); ?>
</button>
</div>
<?php if ( 'amazon' === $order->gateway ) : ?>
<div class="edd-order-overview-actions__notice notice notice-warning">
<p><?php esc_attr_e( 'Orders placed through the Amazon gateway must be refunded through Amazon. The order status can then be updated manually.', 'easy-digital-downloads' ); ?></p>
</div>
<?php endif; ?>
<?php endif; ?>

View File

@ -0,0 +1,48 @@
<?php
/**
* Order Overview: Adjustment Discount
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$view_url = edd_get_admin_url(
array(
'page' => 'edd-discounts',
'edd-action' => 'edit_discount',
)
);
?>
<td></td>
<td class="column-primary" colspan="{{ data.config.colspan }}">
<div class="removable">
<# if ( true === data.state.isAdding ) { #>
<button class="button-link delete">
<span class="dashicons dashicons-no"></span>
<span class="screen-reader-text"><?php printf( __( 'Remove discount', 'easy-digital-downloads' ) ); ?></span>
</button>
<# } #>
<div>
<a href="<?php echo esc_url( $view_url ); ?>&discount={{ data.typeId }}">{{ data.description }}</a>
<br />
<small>
<?php esc_html_e( 'Discount', 'easy-digital-downloads' ); ?>
</small>
</div>
</div>
</td>
<td class="column-right" data-colname="<?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?>">
&ndash;{{ data.totalCurrency }}
</td>
<input type="hidden" value="{{ data.typeId }}" name="discounts[{{ data.id }}][type_id]" />
<input type="hidden" value="{{ data.description }}" name="discounts[{{ data.id }}][code]" />
<input type="hidden" value="{{ data.subtotal }}" name="discounts[{{ data.id }}][subtotal]" />
<input type="hidden" value="{{ data.total }}" name="discounts[{{ data.id }}][total]" />

View File

@ -0,0 +1,65 @@
<?php
/**
* Order Overview: Adjustment
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$view_url = edd_get_admin_url(
array(
'page' => 'edd-discounts',
'edd-action' => 'edit_discount',
)
);
?>
<td></td>
<td class="column-primary" colspan="{{ data.config.colspan }}">
<div class="removable">
<# if ( true === data.state.isAdding ) { #>
<button class="button-link delete">
<span class="dashicons dashicons-no"></span>
<span class="screen-reader-text"><?php printf( __( 'Remove %s', 'easy-digital-downloads' ), '{{{ data.type }}}' ); ?></span>
</button>
<# } #>
<div>
<# if ( false !== data.orderItem ) { #>
{{ data.orderItem.productName }}:&nbsp;
<# } #>
<# if ( '' !== data.description ) { #>
{{ data.description }}
<# } #>
<# if ( '' !== data.description || false !== data.orderItem ) { #>
<br />
<small>
<# } #>
<# if ( 'credit' === data.type ) { #>
<?php esc_html_e( 'Order Credit', 'easy-digital-downloads' ); ?>
<# } else { #>
<?php esc_html_e( 'Order Fee', 'easy-digital-downloads' ); ?>
<# } #>
<# if ( '' !== data.description || false !== data.orderItem ) { #>
</small>
<# } #>
</div>
</div>
</td>
<td class="column-right" data-colname="<?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?>">
<# if ( 'fee' !== data.type || data.subtotal < 0 ) { #>&ndash;<# } #>{{ data.subtotalCurrency }}
</td>
<input type="hidden" value="{{ data.objectId }}" name="adjustments[{{ data.id }}][object_id]" />
<input type="hidden" value="{{ data.objectType }}" name="adjustments[{{ data.id }}][object_type]" />
<input type="hidden" value="{{ data.type }}" name="adjustments[{{ data.id }}][type]" />
<input type="hidden" value="{{ data.description }}" name="adjustments[{{ data.id }}][description]" />
<input type="hidden" value="{{ data.subtotal }}" name="adjustments[{{ data.id }}][subtotal]" />
<input type="hidden" value="{{ data.tax }}" name="adjustments[{{ data.id }}][tax]" />
<input type="hidden" value="{{ data.total }}" name="adjustments[{{ data.id }}][total]" />

View File

@ -0,0 +1,39 @@
<?php
/**
* Order Overview: Copy Download Links
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
?>
<div class="edd-order-overview-modal">
<form class="edd-order-copy-download-link">
<p>
<label for="link">
<?php echo esc_html( sprintf( __( '%s Links', 'easy-digital-downloads' ), edd_get_label_singular() ) ); ?>
</label>
<# if ( false === data.link ) { #>
<span class="spinner is-active" style="float: none; margin: 0;"></span>
<# } else if ( '' === data.link ) { #>
<?php esc_html_e( 'No file links available', 'easy-digital-downloads' ); ?>
<# } else { #>
<textarea rows="10" id="link">{{ data.link }}</textarea>
<# } #>
</p>
<p class="submit">
<input
id="close"
type="submit"
class="button button-primary edd-ml-auto"
value="<?php esc_html_e( 'Close', 'easy-digital-downloads' ); ?>"
/>
</p>
</form>
</div>

View File

@ -0,0 +1,174 @@
<?php
/**
* Order Overview: Add Adjustment form
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
?>
<div class="edd-order-overview-modal">
<form class="edd-order-overview-add-adjustment">
<fieldset>
<legend>
<?php esc_html_e( 'Type', 'easy-digital-downloads' ); ?>
</legend>
<p>
<label for="fee">
<input
type="radio"
id="fee"
name="type"
value="fee"
<# if ( 'fee' === data.type ) { #>
checked
<# } #>
/>
<?php echo esc_html_e( 'Fee', 'easy-digital-downloads' ); ?>
</label>
</p>
<p>
<label for="credit">
<input
type="radio"
id="credit"
name="type"
value="credit"
<# if ( 'credit' === data.type ) { #>
checked
<# } #>
/>
<?php echo esc_html_e( 'Credit', 'easy-digital-downloads' ); ?>
</label>
</p>
</fieldset>
<# if ( 'fee' === data.type && data.orderItems.length > 0 ) { #>
<p>
<label for="object_type">
<?php esc_html_e( 'Apply to', 'easy-digital-downloads' ); ?>
</label>
<select
id="object_type"
class="edd-select"
required
>
<option value="order"><?php esc_html_e( 'Entire order', 'easy-digital-downloads' ); ?></option>
<# _.each( data.orderItems, ( item ) => { #>
<option
value="order_item"
data-order-item-id={{ item.id }}
<# if ( item.id === data.objectId ) { #>
selected
<# } #>
>
{{ item.productName }}
</option>
<# } ); #>
</select>
</p>
<# } #>
<p>
<label for="amount">
<?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?>
</label>
<span class="edd-amount">
<?php if ( 'before' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
<input
type="text"
id="amount"
value="{{ data.amountManual }}"
required
/>
<?php if ( 'after' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
</span>
</p>
<# if ( 'none' !== data.state.hasTax && 'fee' === data.type ) { #>
<p>
<label
class="edd-toggle"
for="no-tax"
>
<input
type="checkbox"
id="no-tax"
<# if ( true === data.isTaxed ) { #>
checked
<# } #>
/>
<span class="label">
<?php esc_html_e( 'Apply tax to fee', 'easy-digital-downloads' ); ?>
<# if ( 'none' !== data.state.hasTax && '' !== data.state.hasTax.country ) { #>
<br />
<small>
<?php
printf(
esc_html__( 'Tax Rate: %s', 'easy-digital-downloads' ),
'{{ data.state.hasTax.country}}<# if ( \'\' !== data.state.hasTax.region ) { #>: {{ data.state.hasTax.region }}<# } #> &ndash; {{ data.state.hasTax.rate }}%'
); // WPCS: XSS okay.
?>
</small>
<# } #>
</span>
</label>
</p>
<# } #>
<#
if (
'fee' === data.type &&
'none' !== data.state.hasTax &&
'' === data.state.hasTax.country
) {
#>
<div class="notice notice-warning">
<p>
<strong><?php esc_html_e( 'No tax rate has been set.', 'easy-digital-downloads' ); ?></strong><br />
<?php esc_html_e( 'Tax rates are defined by the customer\'s billing address.', 'easy-digital-downloads' ); ?>
</p>
<p>
<button class="button button-secondary" id="set-address">
<?php esc_html_e( 'Set an address', 'easy-digital-downloads' ); ?>
</button>
</p>
</div>
<# } #>
<p>
<label for="description">
<?php esc_html_e( 'Description', 'easy-digital-downloads' ); ?>
</label>
<input
type="text"
id="description"
value="{{ data.description }}"
/>
</p>
<p class="submit">
<input
id="submit"
type="submit"
class="button button-primary edd-ml-auto"
value="<?php esc_html_e( 'Add Adjustment', 'easy-digital-downloads' ); ?>"
<# if ( 0 === data.total ) { #>
disabled
<# } #>
/>
</p>
</form>
</div>

View File

@ -0,0 +1,72 @@
<?php
/**
* Order Overview: Add Discount form
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$discounts = edd_get_discounts( array(
'number' => 100,
'status' => 'active',
) );
?>
<div class="edd-order-overview-modal">
<form class="edd-order-overview-add-discount">
<p>
<label for="discount">
<?php esc_html_e( 'Discount', 'easy-digital-downloads' ); ?>
</label>
<select
id="discount"
class="edd-select"
required
>
<option value=""><?php esc_html_e( 'Choose a discount', 'easy-digital-downloads' ); ?></option>
<?php
if ( false !== $discounts ) :
foreach ( $discounts as $discount ) :
?>
<option
data-code="<?php echo esc_attr( $discount->code ); ?>"
value="<?php echo esc_attr( $discount->id ); ?>"
<# if ( <?php echo esc_js( $discount->id ); ?> === data.typeId ) { #>
selected
<# } #>
>
<?php echo esc_html( $discount->code ); ?> &ndash; <?php echo esc_html( $discount->name ); ?>
</option>
<?php
endforeach;
endif;
?>
</select>
<# if ( true === data._isDuplicate ) { #>
<span class="edd-order-overview-error">
<?php esc_html_e( 'This Discount already applied to the Order.', 'easy-digital-downloads' ); ?>
</span>
<# } #>
</p>
<p class="submit">
<# if ( true === data.state.isFetching ) { #>
<span class="spinner is-active edd-ml-auto"></span>
<# } #>
<input
type="submit"
class="button button-primary edd-ml-auto"
value="<?php esc_html_e( 'Add Discount', 'easy-digital-downloads' ); ?>"
<# if ( 0 === data.typeId || true === data._isDuplicate || true === data.state.isFetching ) { #>
disabled
<# } #>
/>
</p>
</form>
</div>

View File

@ -0,0 +1,260 @@
<?php
/**
* Order Overview: Add Item form
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$currency_position = edd_get_option( 'currency_position', 'before' );
//
// Retrieve a list of recent Downloads to populate list.
//
// @todo this is similar to edd_ajax_download_search() but
// that cannot be used because it requires $_GET requests.
//
$downloads = array();
$recent_downloads = get_posts( array(
'fields' => 'ids',
'orderby' => 'date',
'order' => 'ASC',
'post_type' => 'download',
'posts_per_page' => 25,
'post_status' => array(
'publish',
'draft',
'private',
'future',
),
) );
if ( ! empty( $recent_downloads ) ) {
foreach ( $recent_downloads as $download_id ) {
$prices = edd_get_variable_prices( $download_id );
// Non-variable items.
if ( empty( $prices ) ) {
$downloads[] = array(
'id' => $download_id,
'name' => edd_get_download_name( $download_id ),
);
// Variable items.
} else {
foreach ( $prices as $key => $value ) {
$name = edd_get_download_name( $download_id, $key );
if ( ! empty( $name ) ) {
$downloads[] = array(
'id' => $download_id . '_' . $key,
'name' => esc_html( $name ),
);
}
}
}
}
}
?>
<div class="edd-order-overview-modal">
<form class="edd-order-overview-add-item">
<# if ( false !== data.state.error ) { #>
<div class="notice notice-error">
<p>{{ data.state.error }}</p>
</div>
<# } #>
<p>
<label for="download">
<?php echo esc_html( edd_get_label_singular() ); ?>
</label>
<select
name="edd-order-add-download-select"
id="download"
class="edd-select edd-order-add-download-select variations variations-only edd-select-chosen"
data-placeholder="<?php echo esc_html_e( 'Search for a download', 'easy-digital-downloads' ); ?>"
data-search-placeholder="<?php echo esc_html_e( 'Search for a download', 'easy-digital-downloads' ); ?>"
data-search-type="download">
<option value=""></option>
<# if ( 0 !== data.productId ) { #>
<option value="{{ data.productId }}<# if ( 0 !== data.priceId ) { #>_{{ data.priceId }}<# } #>" selected>{{ data.productName }}</option>
<# } #>
<?php foreach ( $downloads as $download ) : ?>
<option value="<?php echo esc_attr( $download['id'] ); ?>"><?php echo esc_html( $download['name'] ); ?></option>
<?php endforeach; ?>
</select>
<# if ( true === data.state.isDuplicate ) { #>
<span class="edd-order-overview-error">
<?php
/* translators: %s "Download" singular label. */
echo esc_html(
sprintf(
__( 'This %s already exists in the Order. Please remove it before adding it again.', 'easy-digital-downloads' ),
edd_get_label_singular()
)
);
?>
</span>
<# } #>
</p>
<# if ( false !== data.state.hasQuantity ) { #>
<p>
<label for="">
<?php esc_html_e( 'Quantity', 'easy-digital-downloads' ); ?>
</label>
<input
type="number"
id="quantity"
class="edd-add-order-quantity"
value="{{ data.quantity }}"
step="1"
min="1"
<# if ( 0 === data.productId || true === data.state.isDuplicate ) { #>
disabled
<# } #>
/>
</p>
<# } #>
<p>
<label
class="edd-toggle"
for="auto-calculate"
>
<input
type="checkbox"
id="auto-calculate"
<# if ( true !== data.state.isAdjustingManually ) { #>
checked
<# } #>
<# if ( 0 === data.productId || true === data.state.isDuplicate ) { #>
disabled
<# } #>
/>
<span class="label">
<?php esc_html_e( 'Automatically calculate amounts', 'easy-digital-downloads' ); ?>
<# if ( 'none' !== data.state.hasTax && '' !== data.state.hasTax.country ) { #>
<br />
<small>
<?php
printf(
esc_html__( 'Tax Rate: %s', 'easy-digital-downloads' ),
'{{ data.state.hasTax.country}}<# if ( \'\' !== data.state.hasTax.region ) { #>: {{ data.state.hasTax.region }}<# } #> &ndash; {{ data.state.hasTax.rate }}%'
); // WPCS: XSS okay.
?>
</small>
<# } #>
</span>
</label>
</p>
<# if ( 'none' !== data.state.hasTax && '' === data.state.hasTax.country && false === data.state.isAdjustingManually ) { #>
<div class="notice notice-warning">
<p>
<strong><?php esc_html_e( 'No tax rate has been set.', 'easy-digital-downloads' ); ?></strong><br />
<?php esc_html_e( 'Tax rates are defined by the customer\'s billing address.', 'easy-digital-downloads' ); ?>
</p>
<p>
<button class="button button-secondary" id="set-address">
<?php esc_html_e( 'Set an address', 'easy-digital-downloads' ); ?>
</button>
</p>
</div>
<# } #>
<# if ( true === data.state.isAdjustingManually ) { #>
<p>
<label for="amount"><?php esc_html_e( 'Unit Price', 'easy-digital-downloads' ); ?></label>
<span class="edd-amount">
<?php if ( 'before' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
<input
type="text"
id="amount"
value="{{ data.amountManual }}"
/>
<?php if ( 'after' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
</span>
</p>
<# if ( 'none' !== data.state.hasTax ) { #>
<p>
<label for="tax">
<?php esc_html_e( 'Tax', 'easy-digital-downloads' ); ?>
<# if ( '' !== data.state.hasTax.country ) { #>
<?php
printf(
esc_html_x( '(%s)', 'add order item tax rate', 'easy-digital-downloads' ),
'{{ data.state.hasTax.country}}<# if ( \'\' !== data.state.hasTax.region ) { #>: {{ data.state.hasTax.region }}<# } #> &ndash; {{ data.state.hasTax.rate }}%'
); // WPCS: XSS okay.
?>
<# } #>
</label>
<span class="edd-amount">
<?php if ( 'before' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
<input
type="text"
id="tax"
value="{{ data.taxManual }}"
/>
<?php if ( 'after' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
</span>
</p>
<# } #>
<p>
<label for="subtotal"><?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?></label>
<span class="edd-amount">
<?php if ( 'before' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
<input
type="text"
id="subtotal"
value="{{ data.subtotalManual }}"
/>
<?php if ( 'after' === $currency_position ) : ?>
<?php echo edd_currency_filter( '' ); ?>
<?php endif; ?>
</span>
</p>
<# } #>
<p class="submit">
<# if ( true === data.state.isFetching ) { #>
<span class="spinner is-active edd-ml-auto"></span>
<# } #>
<input
type="submit"
class="button button-primary edd-ml-auto"
value="<?php echo esc_html( sprintf( __( 'Add %s', 'easy-digital-downloads' ), edd_get_label_singular() ) ); ?>"
<# if ( 0 === data.productId || true === data.state.isDuplicate || true === data.state.isFetching ) { #>
disabled
<# } #>
/>
</p>
</form>
</div>

View File

@ -0,0 +1,90 @@
<?php
/**
* Order Overview: Item
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$view_url = add_query_arg(
array(
'action' => 'edit',
),
admin_url( 'post.php' )
);
?>
<td class="has-row-actions column-primary">
<div class="removable">
<# if ( true === data.state.isAdding ) { #>
<button class="button-link delete" >
<span class="dashicons dashicons-no" id="remove-item"></span>
<span class="screen-reader-text"><?php printf( __( 'Remove %s', 'easy-digital-downloads' ), '{{{ data.productName }}}' ); ?></span>
</button>
<# } #>
<div class="edd-order-overview-summary__items-name">
<a
href="<?php echo esc_url( $view_url ); ?>&post={{ data.productId }}"
class="row-title"
>
{{{ data.productName }}}
</a>
<# if ( false === data.state.isRefund ) { #>
<# if ( [ 'refunded', 'partially_refunded' ].includes( data.status ) ) { #>
&mdash; {{{ data.statusLabel }}}
<# } #>
<# } #>
<div class="row-actions">
<# if ( 'none' !== data.state.hasTax ) { #>
<span class="text">
<strong><?php esc_html_e( 'Tax:', 'easy-digital-downloads' ); ?></strong>
{{ data.taxCurrency }}
<# if ( true === data.config.isAdjustingManually ) { #>&dagger;<# } #>
</span>
<# } #>
<# if ( false === data.state.isAdding && true === data.deliverable ) { #>
<span>
<button class="button-link copy-download-link">
<?php echo esc_html( sprintf( __( 'Copy %s Links', 'easy-digital-downloads' ), edd_get_label_singular() ) ); ?>
</button>
</span>
<# } #>
</div>
</div>
<button type="button" class="toggle-row">
<span class="screen-reader-text"><?php esc_html_e( 'Show more details', 'easy-digital-downloads' ); ?></span>
</button>
</div>
</td>
<td data-colname="<?php esc_html_e( 'Unit Price', 'easy-digital-downloads' ); ?>">
{{ data.amountCurrency }}
<# if ( true === data.config.isAdjustingManually ) { #>&dagger;<# } #>
</td>
<# if ( true === data.state.hasQuantity ) { #>
<td data-colname="<?php esc_html_e( 'Quantity', 'easy-digital-downloads' ); ?>">
{{ data.quantity }}
</td>
<# } #>
<td class="column-right" data-colname="<?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?>">
{{ data.subtotalCurrency }}
<# if ( true === data.config.isAdjustingManually ) { #>&dagger;<# } #>
</td>
<input type="hidden" value="{{ data.productId }}" name="downloads[{{ data.id }}][id]" />
<input type="hidden" value="{{ data.priceId }}" name="downloads[{{ data.id }}][price_id]" />
<input type="hidden" value="{{ data.quantity }}" name="downloads[{{ data.id }}][quantity]" />
<input type="hidden" value="{{ data.amount }}" name="downloads[{{ data.id }}][amount]" />
<input type="hidden" value="{{ data.discount }}" name="downloads[{{ data.id }}][discount]" />
<input type="hidden" value="{{ data.tax }}" name="downloads[{{ data.id }}][tax]" />
<input type="hidden" value="{{ data.subtotal }}" name="downloads[{{ data.id }}][subtotal]" />
<input type="hidden" value="{{ data.total }}" name="downloads[{{ data.id }}][total]" />

View File

@ -0,0 +1,15 @@
<?php
/**
* Order Overview: No Items
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
?>
<td colspan="{{ data.config.colspan }}">
<?php esc_html_e( 'No order items', 'easy-digital-downloads' ); ?>
</td>

View File

@ -0,0 +1,41 @@
<?php
/**
* Order Overview: Refunds
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
$view_url = edd_get_admin_url( array(
'page' => 'edd-payment-history',
'view' => 'view-refund-details',
) );
?>
<td></td>
<td colspan="{{ data.config.colspan }}" class="column-primary">
<?php
echo wp_kses(
sprintf(
/* translators: %s Refund number, linked to Refund record. */
__( 'Refund: %s', 'easy-digital-downloads' ),
'<a href="' . esc_url( $view_url ) . '&id={{ data.id }}">{{ data.number }}</a>'
),
array(
'a' => array(
'href' => true,
),
)
);
?>
<br />
<small>{{ data.dateCreated }}</small>
</td>
<td class="column-right" data-colname="<?php esc_html_e( 'Total', 'easy-digital-downloads' ); ?>">
{{ data.totalCurrency }}
</td>

View File

@ -0,0 +1,23 @@
<?php
/**
* Order Overview: Subtotal
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2021, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
?>
<tr class="is-expanded">
<td></td>
<td colspan="{{ data.config.colspan }}" class="column-primary">
<?php esc_html_e( 'Subtotal', 'easy-digital-downloads' ); ?>
</td>
<td class="column-right" data-colname="<?php esc_attr_e( 'Amount', 'easy-digital-downloads' ); ?>">
{{ data.subtotalCurrency }}
</td>
</tr>
<input type="hidden" value="{{ data.subtotal }}" name="subtotal" />

View File

@ -0,0 +1,73 @@
<?php
/**
* Order Overview: Tax
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2021, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
?>
<# if ( 'none' !== data.state.hasTax && false !== data.state.hasTax.rate ) { #>
<tr class="is-expanded">
<td></td>
<td colspan="{{ data.config.colspan }}" class="column-primary">
<# if ( false !== data.state.hasTax.rate && '' !== data.state.hasTax.country ) { #>
{{ data.state.hasTax.country }}<# if ( '' !== data.state.hasTax.region ) { #>: {{ data.state.hasTax.region }}<# } #> &ndash; {{ data.state.hasTax.rate }}%
<br />
<# } else if ( false !== data.state.hasTax.rate ) { #>
{{ data.state.hasTax.rate }}%
<br />
<# } #>
<small>
<?php esc_html_e( 'Tax', 'easy-digital-downloads' ); ?>
</small>
</td>
<td class="column-right" data-colname="<?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?>">
{{ data.taxCurrency }}
</td>
</tr>
<# if ( false !== data.state.hasNewTaxRate && true === data.hasTaxableItems ) { #>
<tr class="is-expanded">
<td></td>
<td colspan="{{ data.config.colspan + 1 }}" style="padding: 0;" class="column-primary">
<div
id="notice-tax-change"
class="notice notice-warning is-dismissible"
>
<p>
<?php
echo esc_html(
sprintf(
__( 'The tax rate has been updated to %1$s. Existing automatically calculated amounts have not been updated.', 'easy-digital-downloads' ),
'{{ data.state.hasTax.rate }}%'
)
);
?>
</p>
<p>
<button
type="button"
class="button button-secondary button-small update-amounts"
style="marign-left: 0;"
>
<?php esc_html_e( 'Update Amounts', 'easy-digital-downloads' ); ?>
</button>
</p>
<button type="button" class="notice-dismiss">
<span class="screen-reader-text"><?php esc_html_e( 'Dismiss this notice.', 'easy-digital-downloads' ); ?></span>
</button>
</div>
</td>
</tr>
<# } #>
<# } #>
<input type="hidden" value="{{ data.tax }}" name="tax" />
<input type="hidden" value="{{ data.state.hasTax.rate }}" name="tax_rate" />

View File

@ -0,0 +1,29 @@
<?php
/**
* Order Overview: Total
*
* @package EDD
* @subpackage Admin/Views
* @copyright Copyright (c) 2020, Sandhills Development, LLC
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
* @since 3.0
*/
?>
<tr class="is-expanded edd-order-overview-summary__total-total">
<td></td>
<td colspan="{{ data.config.colspan }}" class="column-primary">
<?php esc_html_e( 'Total', 'easy-digital-downloads' ); ?>
<# if ( data.state.hasManualAdjustment ) { #>
<br />
<small><?php esc_html_e( '&dagger; Some amounts have been manually adjusted.', 'easy-digital-downloads' ); ?></small>
<# } #>
</td>
<td class="column-right" data-colname="<?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?>">
<span class="total <# if ( data.total < 0 ) { #>is-negative<# } #>">{{ data.totalCurrency }}</span>
</td>
</tr>
<input type="hidden" value="{{ data.discount }}" name="discount" />
<input type="hidden" value="{{ data.total }}" name="total" />

View File

@ -0,0 +1,44 @@
<?php
/**
* Admin tax table add "form".
*
* @since 3.0
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 1.0.0
*/
?>
<tr class="edd-tax-rate-table-add">
<th colspan="2">
<label for="tax_rate_country" class="screen-reader-text"><?php esc_html_e( 'Country', 'easy-digital-downloads' ); ?></label>
<?php
echo EDD()->html->country_select( array(
'id' => 'tax_rate_country',
) );
?>
</th>
<th>
<label for="tax_rate_region" class="screen-reader-text"><?php esc_html_e( 'Region', 'easy-digital-downloads' ); ?></label>
<label>
<input type="checkbox" id="tax_rate_region_global" checked disabled /><?php esc_html_e( 'Apply to whole country', 'easy-digital-downloads' ); ?>
</label>
<div id="tax_rate_region_wrapper"></div>
</th>
<th>
<label for="tax_rate_amount" class="screen-reader-text"><?php esc_html_e( 'Rate', 'easy-digital-downloads' ); ?></label>
<input type="number" step="0.0001" min="0.0" max="99" id="tax_rate_amount" />
</th>
<th class="edd-tax-rates-table-actions">
<button id="tax_rate_submit" class="button button-secondary"><?php esc_html_e( 'Add Rate', 'easy-digital-downloads' ); ?></button>
</th>
</tr>

View File

@ -0,0 +1,33 @@
<?php
/**
* Admin tax table bulk actions.
*
* @since 3.0
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 1.0.0
*/
?>
<div class="tablenav top">
<div class="edd-admin-tax-rates__tablenav--left">
<select id="edd-admin-tax-rates-table-bulk-actions">
<option><?php esc_html_e( 'Bulk Actions', 'easy-digital-downloads' ); ?></option>
<option value="active"><?php esc_html_e( 'Activate', 'easy-digital-downloads' ); ?></option>
<option value="inactive"><?php esc_html_e( 'Deactivate', 'easy-digital-downloads' ); ?></option>
</select>
<button class="button edd-admin-tax-rates-table-filter"><?php esc_html_e( 'Apply', 'easy-digital-downloads' ); ?></button>
</div>
<div class="edd-admin-tax-rates__tablenav--right">
<label class="edd-toggle edd-admin-tax-rates-table-hide">
<span class="label"><?php esc_html_e( 'Show deactivated rates', 'easy-digital-downloads' ); ?></span>
<input type="checkbox" id="hide-deactivated" />
</label>
</div>
</div>

View File

@ -0,0 +1,20 @@
<?php
/**
* Admin tax table "meta" (thead or tfoot).
*
* @since 3.0
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 1.0.0
*/
?>
<tr>
<td class="edd-tax-rates-table-checkbox check-column"><input type="checkbox" /></td>
<th class="edd-tax-rates-table-country"><?php esc_html_e( 'Country', 'easy-digital-downloads' ); ?></th>
<th><?php esc_html_e( 'Region', 'easy-digital-downloads' ); ?></th>
<th class="edd-tax-rates-table-rate"><?php esc_html_e( 'Rate', 'easy-digital-downloads' ); ?></th>
<th class="edd-tax-rates-table-actions"><?php esc_html_e( 'Actions', 'easy-digital-downloads' ); ?></th>
</tr>

View File

@ -0,0 +1,16 @@
<?php
/**
* Admin tax table rate row when no rates are available.
*
* @since 3.0
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 1.0.0
*/
?>
<td colspan="5">
<?php esc_html_e( 'No rates found.', 'easy-digital-downloads' ); ?>
</td>

View File

@ -0,0 +1,55 @@
<?php
/**
* Admin tax table rate row.
*
* @since 3.0
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 1.0.0
*/
?>
<th class="edd-tax-rates-table-checkbox check-column">
<input type="checkbox" <# if ( data.selected ) { #>checked<# } #> />
</th>
<td class="edd-tax-rates-table-country" data-colname="<?php esc_attr_e( 'Country', 'easy-digital-downloads' ); ?>">
<# if ( data.country ) { #>
{{ data.country }}
<# } else { #>
*
<# } #>
<input type="hidden" name="tax_rates[{{ data.id }}][country]" value="{{ data.country }}" />
</td>
<td data-colname="<?php esc_attr_e( 'Region', 'easy-digital-downloads' ); ?>">
<# if ( data.global ) { #>
&mdash;
<input type="hidden" name="tax_rates[{{ data.id }}][global]" value="{{ data.global }}" />
<# } else if ( data.region ) { #>
{{ data.region }}
<input type="hidden" name="tax_rates[{{ data.id }}][state]" value="{{ data.region }}" />
<# } else { #>
&mdash;
<input type="hidden" name="tax_rates[{{ data.id }}][state]" value="" />
<# } #>
</td>
<td data-colname="<?php esc_attr_e( 'Rate', 'easy-digital-downloads' ); ?>">
{{ data.formattedAmount }}
<input type="hidden" name="tax_rates[{{ data.id }}][rate]" value="{{ data.amount }}" />
</td>
<td class="edd-tax-rates-table-actions" data-colname="<?php esc_attr_e( 'Actions', 'easy-digital-downloads' ); ?>">
<# if ( data.unsaved ) { #>
<button class="button-link remove" data-cid="{{ data.id }}"><?php esc_html_e( 'Remove', 'easy-digital-downloads' ); ?></button>
<# } else if ( 'active' === data.status ) { #>
<button class="button-link deactivate"><?php esc_html_e( 'Deactivate', 'easy-digital-downloads' ); ?></button>
<# } else { #>
<button class="button-link activate"><?php esc_html_e( 'Activate', 'easy-digital-downloads' ); ?></button>
<# } #>
<input type="hidden" name="tax_rates[{{ data.id }}][status]" value="{{ data.status }}" />
</td>