installed plugin Easy Digital Downloads
version 3.1.0.3
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$credits = $order->get_credits();
|
||||
if ( empty( $credits ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php echo esc_html( _n( 'Credit', 'Credits', count( $credits ), 'easy-digital-downloads' ) ); ?>:</div>
|
||||
</div>
|
||||
<?php
|
||||
foreach ( $credits as $credit ) {
|
||||
$label = __( 'Credit', 'easy-digital-downloads' );
|
||||
if ( ! empty( $credit->description ) ) {
|
||||
$label = $credit->description;
|
||||
}
|
||||
?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php echo esc_html( $label ); ?></div>
|
||||
<div><?php echo esc_html( edd_display_amount( edd_negate_amount( $credit->total ), $order->currency ) ); ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
$order_discounts = $order->get_discounts();
|
||||
if ( ! $order_discounts ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$label = _n( 'Discount', 'Discounts', count( $order_discounts ), 'easy-digital-downloads' );
|
||||
?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php echo esc_html( $label ); ?>:</div>
|
||||
</div>
|
||||
<?php
|
||||
foreach ( $order_discounts as $order_discount ) {
|
||||
$label = $order_discount->description;
|
||||
if ( 'percent' === edd_get_discount_type( $order_discount->type_id ) ) {
|
||||
$rate = edd_format_discount_rate( 'percent', edd_get_discount_amount( $order_discount->type_id ) );
|
||||
$label .= " ({$rate})";
|
||||
}
|
||||
?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div><?php echo esc_html( $label ); ?></div>
|
||||
<div><?php echo esc_html( edd_display_amount( edd_negate_amount( $order_discount->total ), $order->currency ) ); ?></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
$fees = $order->get_fees();
|
||||
if ( empty( $fees ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php echo esc_html( _n( 'Fee', 'Fees', count( $fees ), 'easy-digital-downloads' ) ); ?>:</div>
|
||||
</div>
|
||||
<?php
|
||||
foreach ( $fees as $fee ) :
|
||||
$label = __( 'Fee', 'easy-digital-downloads' );
|
||||
if ( ! empty( $fee->description ) ) {
|
||||
$label = $fee->description;
|
||||
}
|
||||
?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div><span class="edd_fee_label"><?php echo esc_html( $label ); ?></span></div>
|
||||
<div><span class="edd_fee_amount"><?php echo esc_html( edd_display_amount( $fee->subtotal, $order->currency ) ); ?></span></div>
|
||||
</div>
|
||||
<?php
|
||||
endforeach;
|
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* @var string $redirect_url
|
||||
*/
|
||||
?>
|
||||
<form id="edd-blocks-form__guest" class="edd-blocks-form edd-blocks-form__guest" action="" method="post">
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-email">
|
||||
<label for="edd_guest_email">
|
||||
<?php
|
||||
esc_html_e( 'Email Address', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<div class="edd-blocks-form__control">
|
||||
<input name="edd_guest_email" id="edd_guest_email" class="edd-required edd-input" type="email" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-submit">
|
||||
<input type="hidden" name="order_id" value="<?php echo absint( $order->id ); ?>"/>
|
||||
<input type="hidden" name="edd_guest_nonce" value="<?php echo esc_attr( wp_create_nonce( 'edd-guest-nonce' ) ); ?>"/>
|
||||
<input type="hidden" name="edd_action" value="view_receipt_guest"/>
|
||||
<input id="edd_guest_submit" type="submit" class="<?php echo esc_attr( implode( ' ', EDD\Blocks\Functions\get_button_classes() ) ); ?>" value="<?php esc_html_e( 'Confirm Email', 'easy-digital-downloads' ); ?>"/>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
if ( empty( $orders ) ) {
|
||||
?>
|
||||
<p><?php esc_html_e( 'You have no orders.', 'easy-digital-downloads' ); ?></p>
|
||||
<?php
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( implode( ' ', array_filter( $classes ) ) ); ?>">
|
||||
<?php
|
||||
foreach ( $orders as $order ) {
|
||||
?>
|
||||
<div class="edd-blocks-orders__order">
|
||||
<div class="edd-blocks-orders__order-header">
|
||||
<div class="edd-blocks-orders__order-id">
|
||||
<?php
|
||||
printf(
|
||||
/* translators: the order */
|
||||
esc_html__( 'Order: %s', 'easy-digital-downloads' ),
|
||||
esc_html( $order->get_number() )
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<div class="edd-blocks-orders__order-status <?php echo esc_html( $order->status ); ?>"><?php echo esc_html( edd_get_status_label( $order->status ) ); ?></div>
|
||||
</div>
|
||||
<div class="edd-blocks-orders__order-data">
|
||||
<div class="edd-blocks-orders__order-date">
|
||||
<?php echo esc_html( edd_date_i18n( EDD()->utils->date( $order->date_created, null, true )->toDateTimeString() ) ); ?>
|
||||
</div>
|
||||
<div class="edd-blocks-orders__order-amount">
|
||||
<?php echo esc_html( edd_display_amount( $order->total, $order->currency ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edd-blocks-orders__order-details">
|
||||
<?php echo \EDD\Blocks\Orders\Functions\get_details( $order ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
if ( $count <= $number ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="edd-blocks-orders__pagination">
|
||||
<?php
|
||||
echo edd_pagination(
|
||||
array(
|
||||
'type' => 'purchase_history',
|
||||
'total' => ceil( $count / $number ),
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
if ( ! $item->is_deliverable() || ! edd_receipt_show_download_files( $item->product_id, $edd_receipt_args, $item ) ) {
|
||||
return;
|
||||
}
|
||||
$download_files = edd_get_download_files( $item->product_id, $item->price_id );
|
||||
?>
|
||||
<ul class="edd_purchase_receipt_files">
|
||||
<?php
|
||||
if ( ! empty( $download_files ) && is_array( $download_files ) ) :
|
||||
foreach ( $download_files as $filekey => $file ) :
|
||||
?>
|
||||
<li class="edd_download_file">
|
||||
<a href="<?php echo esc_url( edd_get_download_file_url( $order->payment_key, $order->email, $filekey, $item->product_id, $item->price_id ) ); ?>" class="edd_download_file_link"><?php echo esc_html( edd_get_file_name( $file ) ); ?></a>
|
||||
</li>
|
||||
<?php
|
||||
/**
|
||||
* Fires at the end of the order receipt files list.
|
||||
*
|
||||
* @since 3.0
|
||||
* @param int $filekey Index of array of files returned by edd_get_download_files() that this download link is for.
|
||||
* @param array $file The array of file information.
|
||||
* @param int $item->product_id The product ID.
|
||||
* @param int $order->id The order ID.
|
||||
*/
|
||||
do_action( 'edd_order_receipt_files', $filekey, $file, $item->product_id, $order->id );
|
||||
endforeach;
|
||||
elseif ( edd_is_bundled_product( $item->product_id ) ) :
|
||||
$bundled_products = edd_get_bundled_products( $item->product_id, $item->price_id );
|
||||
|
||||
foreach ( $bundled_products as $bundle_item ) :
|
||||
?>
|
||||
|
||||
<li class="edd_bundled_product">
|
||||
<span class="edd_bundled_product_name"><?php echo esc_html( edd_get_bundle_item_title( $bundle_item ) ); ?></span>
|
||||
<ul class="edd_bundled_product_files">
|
||||
<?php
|
||||
$bundle_item_id = edd_get_bundle_item_id( $bundle_item );
|
||||
$bundle_item_price_id = edd_get_bundle_item_price_id( $bundle_item );
|
||||
$download_files = edd_get_download_files( $bundle_item_id, $bundle_item_price_id );
|
||||
|
||||
if ( $download_files && is_array( $download_files ) ) :
|
||||
foreach ( $download_files as $filekey => $file ) :
|
||||
?>
|
||||
<li class="edd_download_file">
|
||||
<a href="<?php echo esc_url( edd_get_download_file_url( $order->payment_key, $order->email, $filekey, $bundle_item, $bundle_item_price_id ) ); ?>" class="edd_download_file_link"><?php echo esc_html( edd_get_file_name( $file ) ); ?></a>
|
||||
</li>
|
||||
<?php
|
||||
/**
|
||||
* Fires at the end of the order receipt bundled files list.
|
||||
*
|
||||
* @since 3.0
|
||||
* @param int $filekey Index of array of files returned by edd_get_download_files() that this download link is for.
|
||||
* @param array $file The array of file information.
|
||||
* @param int $item->product_id The product ID.
|
||||
* @param array $bundle_item The array of information about the bundled item.
|
||||
* @param int $order->id The order ID.
|
||||
*/
|
||||
do_action( 'edd_order_receipt_bundle_files', $filekey, $file, $item->product_id, $bundle_item, $order->id );
|
||||
endforeach;
|
||||
else :
|
||||
echo '<li>' . esc_html__( 'No downloadable files found for this bundled item.', 'easy-digital-downloads' ) . '</li>';
|
||||
endif;
|
||||
?>
|
||||
</ul>
|
||||
</li>
|
||||
<?php
|
||||
endforeach;
|
||||
|
||||
else :
|
||||
echo '<li>' . esc_html( apply_filters( 'edd_receipt_no_files_found_text', __( 'No downloadable files found.', 'easy-digital-downloads' ), $item->product_id ) ) . '</li>';
|
||||
endif;
|
||||
?>
|
||||
</ul>
|
@ -0,0 +1,48 @@
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item edd-blocks-receipt__item">
|
||||
<div class="edd-blocks-receipt__item-details">
|
||||
<div class="edd-blocks__row-label">
|
||||
<?php
|
||||
echo esc_html( $item->product_name );
|
||||
|
||||
if ( ! empty( $item->status ) && 'complete' !== $item->status ) {
|
||||
echo ' – ' . esc_html( edd_get_status_label( $item->status ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$notes = edd_get_product_notes( $item->product_id );
|
||||
if ( ! empty( $notes ) ) :
|
||||
?>
|
||||
<div class="edd_purchase_receipt_product_notes"><?php echo wp_kses_post( wpautop( $notes ) ); ?></div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
require 'receipt-files.php';
|
||||
|
||||
if ( edd_use_skus() ) :
|
||||
?>
|
||||
<div class="edd-blocks-receipt__item-sku">
|
||||
<span class="edd-blocks__row-label"><?php esc_html_e( 'SKU:' ); ?></span>
|
||||
<?php echo esc_html( edd_get_download_sku( $item->product_id ) ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( edd_item_quantities_enabled() ) { ?>
|
||||
<div class="edd-blocks-receipt__item-quantity">
|
||||
<span class="edd-blocks__row-label"><?php esc_html_e( 'Quantity:' ); ?></span>
|
||||
<?php echo esc_html( $item->quantity ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
/**
|
||||
* Allow extensions to extend the product cell.
|
||||
* @since 3.0
|
||||
* @param \EDD\Orders\Order_Item $item The current order item.
|
||||
* @param \EDD\Orders\Order $order The current order object.
|
||||
*/
|
||||
do_action( 'edd_order_receipt_after_files', $item, $order );
|
||||
?>
|
||||
</div>
|
||||
<div class="edd-blocks-receipt__item-price">
|
||||
<?php echo esc_html( edd_display_amount( $item->total, $order->currency ) ); ?>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
// Display a notice if the order was not found in the database.
|
||||
if ( ! $order ) : ?>
|
||||
|
||||
<div class="edd_errors edd-alert edd-alert-error">
|
||||
<?php esc_html_e( 'The specified receipt ID appears to be invalid.', 'easy-digital-downloads' ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
return;
|
||||
endif;
|
||||
|
||||
$order_items = $order->get_items();
|
||||
if ( empty( $order_items ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
|
||||
<h3><?php echo esc_html( apply_filters( 'edd_payment_receipt_products_title', __( 'Products', 'easy-digital-downloads' ) ) ); ?></h3>
|
||||
|
||||
<div class="edd-blocks-receipt__items">
|
||||
<?php
|
||||
foreach ( $order_items as $key => $item ) {
|
||||
// Skip this item if we can't view it.
|
||||
if ( ! apply_filters( 'edd_user_can_view_receipt_item', true, $item ) ) {
|
||||
continue;
|
||||
}
|
||||
include 'receipt-item.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/**
|
||||
* Allows additional output before displaying the receipt table.
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
* @param \EDD\Orders\Order $order Current order.
|
||||
* @param array $edd_receipt_args [edd_receipt] shortcode arguments.
|
||||
*/
|
||||
do_action( 'edd_order_receipt_before_table', $order, array() );
|
||||
?>
|
||||
<div class="edd-blocks-receipt__totals">
|
||||
<div class="edd-blocks__row edd-blocks__row-header edd-blocks-receipt__row-header">
|
||||
<div class="edd-blocks__row-label"><?php echo esc_html_x( 'Order', 'heading', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value"><?php echo esc_html( $order->get_number() ); ?></div>
|
||||
</div>
|
||||
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Order Status', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value edd_receipt_payment_status <?php echo esc_attr( strtolower( $order->status ) ); ?>"><?php echo esc_html( edd_get_status_label( $order->status ) ); ?></div>
|
||||
</div>
|
||||
|
||||
<?php if ( $edd_receipt_args['payment_key'] ) : ?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Payment Key', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value"><?php echo esc_html( $order->payment_key ); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $edd_receipt_args['payment_method'] ) : ?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Payment Method', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value"><?php echo esc_html( edd_get_gateway_checkout_label( $order->gateway ) ); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Date', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value"><?php echo esc_html( edd_date_i18n( EDD()->utils->date( $order->date_created, null, true )->toDateTimeString() ) ); ?></div>
|
||||
</div>
|
||||
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Subtotal', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value">
|
||||
<?php echo esc_html( edd_payment_subtotal( $order->id ) ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
require EDD_BLOCKS_DIR . 'views/orders/discounts.php';
|
||||
require EDD_BLOCKS_DIR . 'views/orders/fees.php';
|
||||
?>
|
||||
|
||||
<?php if ( $order->tax > 0 ) : ?>
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Tax', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value"><?php echo esc_html( edd_payment_tax( $order->id ) ); ?></div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php require EDD_BLOCKS_DIR . 'views/orders/credits.php'; ?>
|
||||
|
||||
<div class="edd-blocks__row edd-blocks-receipt__row-item">
|
||||
<div class="edd-blocks__row-label"><?php esc_html_e( 'Total', 'easy-digital-downloads' ); ?>:</div>
|
||||
<div class="edd-blocks__row-value"><?php echo esc_html( edd_payment_amount( $order->id ) ); ?></div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
do_action( 'edd_order_receipt_order_details', $order );
|
||||
if ( has_action( 'edd_order_receipt_after' ) ) {
|
||||
?>
|
||||
<div class="edd-blocks-receipt__row-item">
|
||||
<?php EDD\Blocks\Orders\Functions\do_order_details( $order, 'edd_order_receipt_after', array() ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
Reference in New Issue
Block a user