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,9 @@
<?php if( ! empty( $_GET['edd-verify-request'] ) ) : ?>
<p class="edd-account-pending edd_success">
<?php _e( 'An email with an activation link has been sent.', 'easy-digital-downloads' ); ?>
</p>
<?php endif; ?>
<p class="edd-account-pending">
<?php $url = esc_url( edd_get_user_verification_request_url() ); ?>
<?php printf( __( 'Your account is pending verification. Please click the link in your email to activate your account. No email? <a href="%s">Click here</a> to send a new activation code.', 'easy-digital-downloads' ), esc_url( $url ) ); ?>
</p>

View File

@ -0,0 +1,133 @@
<?php
/**
* This template is used to display the Checkout page when items are in the cart
*/
global $post; ?>
<table id="edd_checkout_cart" <?php if ( ! edd_is_ajax_disabled() ) { echo 'class="ajaxed"'; } ?>>
<thead>
<tr class="edd_cart_header_row">
<?php do_action( 'edd_checkout_table_header_first' ); ?>
<th class="edd_cart_item_name"><?php _e( 'Item Name', 'easy-digital-downloads' ); ?></th>
<th class="edd_cart_item_price"><?php _e( 'Item Price', 'easy-digital-downloads' ); ?></th>
<th class="edd_cart_actions"><?php _e( 'Actions', 'easy-digital-downloads' ); ?></th>
<?php do_action( 'edd_checkout_table_header_last' ); ?>
</tr>
</thead>
<tbody>
<?php $cart_items = edd_get_cart_contents(); ?>
<?php do_action( 'edd_cart_items_before' ); ?>
<?php if ( $cart_items ) : ?>
<?php foreach ( $cart_items as $key => $item ) : ?>
<tr class="edd_cart_item" id="edd_cart_item_<?php echo esc_attr( $key ) . '_' . esc_attr( $item['id'] ); ?>" data-download-id="<?php echo esc_attr( $item['id'] ); ?>">
<?php do_action( 'edd_checkout_table_body_first', $item ); ?>
<td class="edd_cart_item_name">
<?php
if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $item['id'] ) ) {
echo '<div class="edd_cart_item_image">';
echo get_the_post_thumbnail( $item['id'], apply_filters( 'edd_checkout_image_size', array( 25,25 ) ) );
echo '</div>';
}
$item_title = edd_get_cart_item_name( $item );
echo '<span class="edd_checkout_cart_item_title">' . esc_html( $item_title ) . '</span>';
/**
* Runs after the item in cart's title is echoed
* @since 2.6
*
* @param array $item Cart Item
* @param int $key Cart key
*/
do_action( 'edd_checkout_cart_item_title_after', $item, $key );
?>
</td>
<td class="edd_cart_item_price">
<?php
echo edd_cart_item_price( $item['id'], $item['options'] );
do_action( 'edd_checkout_cart_item_price_after', $item );
?>
</td>
<td class="edd_cart_actions">
<?php if( edd_item_quantities_enabled() && ! edd_download_quantities_disabled( $item['id'] ) ) : ?>
<input type="number" min="1" step="1" name="edd-cart-download-<?php echo esc_attr( $key ); ?>-quantity" data-key="<?php echo esc_attr( $key ); ?>" class="edd-input edd-item-quantity" value="<?php echo esc_attr( edd_get_cart_item_quantity( $item['id'], $item['options'] ) ); ?>"/>
<input type="hidden" name="edd-cart-downloads[]" value="<?php echo esc_attr( $item['id'] ); ?>"/>
<input type="hidden" name="edd-cart-download-<?php echo esc_attr( $key ); ?>-options" value="<?php echo esc_attr( json_encode( $item['options'] ) ); ?>"/>
<?php endif; ?>
<?php do_action( 'edd_cart_actions', $item, $key ); ?>
<a class="edd_cart_remove_item_btn" href="<?php echo esc_url( wp_nonce_url( edd_remove_item_url( $key ), 'edd-remove-from-cart-' . sanitize_key( $key ), 'edd_remove_from_cart_nonce' ) ); ?>"><?php esc_html_e( 'Remove', 'easy-digital-downloads' ); ?></a>
</td>
<?php do_action( 'edd_checkout_table_body_last', $item ); ?>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php do_action( 'edd_cart_items_middle' ); ?>
<!-- Show any cart fees, both positive and negative fees -->
<?php if( edd_cart_has_fees() ) : ?>
<?php foreach( edd_get_cart_fees() as $fee_id => $fee ) : ?>
<tr class="edd_cart_fee" id="edd_cart_fee_<?php echo $fee_id; ?>">
<?php do_action( 'edd_cart_fee_rows_before', $fee_id, $fee ); ?>
<td class="edd_cart_fee_label"><?php echo esc_html( $fee['label'] ); ?></td>
<td class="edd_cart_fee_amount"><?php echo esc_html( edd_currency_filter( edd_format_amount( $fee['amount'] ) ) ); ?></td>
<td>
<?php if( ! empty( $fee['type'] ) && 'item' == $fee['type'] ) : ?>
<a href="<?php echo esc_url( edd_remove_cart_fee_url( $fee_id ) ); ?>"><?php _e( 'Remove', 'easy-digital-downloads' ); ?></a>
<?php endif; ?>
</td>
<?php do_action( 'edd_cart_fee_rows_after', $fee_id, $fee ); ?>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php do_action( 'edd_cart_items_after' ); ?>
</tbody>
<tfoot>
<?php if( has_action( 'edd_cart_footer_buttons' ) ) : ?>
<tr class="edd_cart_footer_row<?php if ( edd_is_cart_saving_disabled() ) { echo ' edd-no-js'; } ?>">
<th colspan="<?php echo absint( edd_checkout_cart_columns() ); ?>">
<?php do_action( 'edd_cart_footer_buttons' ); ?>
</th>
</tr>
<?php endif; ?>
<?php if( edd_use_taxes() && ! edd_prices_include_tax() ) : ?>
<tr class="edd_cart_footer_row edd_cart_subtotal_row"<?php if ( ! edd_is_cart_taxed() ) echo ' style="display:none;"'; ?>>
<?php do_action( 'edd_checkout_table_subtotal_first' ); ?>
<th colspan="<?php echo absint( edd_checkout_cart_columns() ); ?>" class="edd_cart_subtotal">
<?php esc_html_e( 'Subtotal', 'easy-digital-downloads' ); ?>:&nbsp;<span class="edd_cart_subtotal_amount"><?php echo edd_cart_subtotal(); // Escaped ?></span>
</th>
<?php do_action( 'edd_checkout_table_subtotal_last' ); ?>
</tr>
<?php endif; ?>
<tr class="edd_cart_footer_row edd_cart_discount_row" <?php if( ! edd_cart_has_discounts() ) echo ' style="display:none;"'; ?>>
<?php do_action( 'edd_checkout_table_discount_first' ); ?>
<th colspan="<?php echo esc_attr( edd_checkout_cart_columns() ); ?>" class="edd_cart_discount">
<?php edd_cart_discounts_html(); ?>
</th>
<?php do_action( 'edd_checkout_table_discount_last' ); ?>
</tr>
<?php if( edd_use_taxes() ) : ?>
<tr class="edd_cart_footer_row edd_cart_tax_row"<?php if( ! edd_is_cart_taxed() ) echo ' style="display:none;"'; ?>>
<?php do_action( 'edd_checkout_table_tax_first' ); ?>
<th colspan="<?php echo esc_attr( edd_checkout_cart_columns() ); ?>" class="edd_cart_tax">
<?php _e( 'Tax', 'easy-digital-downloads' ); ?>:&nbsp;<span class="edd_cart_tax_amount" data-tax="<?php echo esc_attr( edd_get_cart_tax() ); ?>"><?php edd_cart_tax( true ); // Escaped ?></span>
</th>
<?php do_action( 'edd_checkout_table_tax_last' ); ?>
</tr>
<?php endif; ?>
<tr class="edd_cart_footer_row">
<?php do_action( 'edd_checkout_table_footer_first' ); ?>
<th colspan="<?php echo esc_attr( edd_checkout_cart_columns() ); ?>" class="edd_cart_total"><?php _e( 'Total', 'easy-digital-downloads' ); ?>: <span class="edd_cart_amount" data-subtotal="<?php echo esc_attr( edd_get_cart_subtotal() ); ?>" data-total="<?php echo esc_attr( edd_get_cart_total() ); ?>"><?php edd_cart_total(); // Escaped ?></span></th>
<?php do_action( 'edd_checkout_table_footer_last' ); ?>
</tr>
</tfoot>
</table>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,16 @@
<?php
/**
* Email Body
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
// {email} is replaced by the content entered in Downloads > Settings > Emails
?>
{email}

View File

@ -0,0 +1,16 @@
<?php
/**
* Email Body
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
// {email} is replaced by the content entered in Downloads > Settings > Emails
?>
{email}

View File

@ -0,0 +1,64 @@
<?php
/**
* Email Footer
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
// For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline.
$template_footer = "
border-top:0;
-webkit-border-radius:3px;
";
$credit = "
border:0;
color: #000000;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size:12px;
line-height:125%;
text-align:center;
";
?>
</div>
</td>
</tr>
</table>
<!-- End Content -->
</td>
</tr>
</table>
<!-- End Body -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- Footer -->
<table border="0" cellpadding="10" cellspacing="0" width="600" id="template_footer" style="<?php echo $template_footer; ?>">
<tr>
<td valign="top">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td colspan="2" valign="middle" id="credit" style="<?php echo $credit; ?>">
<?php echo wpautop( wp_kses_post( wptexturize( apply_filters( 'edd_email_footer_text', '<a href="' . esc_url( home_url() ) . '">' . get_bloginfo( 'name' ) . '</a>' ) ) ) ); ?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- End Footer -->
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
<?php
/**
* Email Footer
*
* This is the footer used if no others are available
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit; ?>
</body>
</html>

View File

@ -0,0 +1,108 @@
<?php
/**
* Email Header
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit;
// For gmail compatibility, including CSS styles in head/body are stripped out therefore styles need to be inline. These variables contain rules which are added to the template inline. !important; is a gmail hack to prevent styles being stripped if it doesn't like something.
$body = "
background-color: #f6f6f6;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
";
$wrapper = "
width:100%;
-webkit-text-size-adjust:none !important;
margin:0;
padding: 70px 0 70px 0;
";
$template_container = "
box-shadow:0 0 0 1px #f3f3f3 !important;
border-radius:3px !important;
background-color: #ffffff;
border: 1px solid #e9e9e9;
border-radius:3px !important;
padding: 20px;
";
$template_header = "
color: #00000;
border-top-left-radius:3px !important;
border-top-right-radius:3px !important;
border-bottom: 0;
font-weight:bold;
line-height:100%;
text-align: center;
vertical-align:middle;
";
$body_content = "
border-radius:3px !important;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
";
$body_content_inner = "
color: #000000;
font-size:14px;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
line-height:150%;
text-align:left;
";
$header_content_h1 = "
color: #000000;
margin:0;
padding: 28px 24px;
display:block;
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size:32px;
font-weight: 500;
line-height: 1.2;
";
$header_img = edd_get_option( 'email_logo', '' );
$heading = EDD()->emails->get_heading();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo get_bloginfo( 'name' ); ?></title>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0" style="<?php echo $body; ?>">
<div style="<?php echo $wrapper; ?>">
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr>
<td align="center" valign="top">
<?php if( ! empty( $header_img ) ) : ?>
<div id="template_header_image">
<?php echo '<p style="margin-top:0;"><img src="' . esc_url( $header_img ) . '" alt="' . get_bloginfo( 'name' ) . '" /></p>'; ?>
</div>
<?php endif; ?>
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_container" style="<?php echo $template_container; ?>">
<?php if ( ! empty ( $heading ) ) : ?>
<tr>
<td align="center" valign="top">
<!-- Header -->
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_header" style="<?php echo $template_header; ?>" bgcolor="#ffffff">
<tr>
<td>
<h1 style="<?php echo $header_content_h1; ?>"><?php echo $heading; ?></h1>
</td>
</tr>
</table>
<!-- End Header -->
</td>
</tr>
<?php endif; ?>
<tr>
<td align="center" valign="top">
<!-- Body -->
<table border="0" cellpadding="0" cellspacing="0" width="520" id="template_body">
<tr>
<td valign="top" style="<?php echo $body_content; ?>">
<!-- Content -->
<table border="0" cellpadding="20" cellspacing="0" width="100%">
<tr>
<td valign="top">
<div style="<?php echo $body_content_inner; ?>">

View File

@ -0,0 +1,20 @@
<?php
/**
* Email Header
*
* This is the header used if no others are available
*
* @author Easy Digital Downloads
* @package Easy Digital Downloads/Templates/Emails
* @version 2.1
*/
// Exit if accessed directly
defined( 'ABSPATH' ) || exit; ?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php echo get_bloginfo( 'name' ); ?></title>
</head>
<body>

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path d="M26.11 8.844c0 .39-.157.78-.44 1.062L12.234 23.344a1.506 1.506 0 0 1-2.122 0l-7.782-7.78a1.506 1.506 0 0 1 0-2.123l2.125-2.126c.28-.28.672-.438 1.062-.438s.78.156 1.062.438l4.594 4.61L21.42 5.656a1.513 1.513 0 0 1 2.125-.001L25.67 7.78c.28.28.438.672.438 1.062z"/></svg>

After

Width:  |  Height:  |  Size: 342 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="28"><path d="M5 12h8V9c0-2.203-1.797-4-4-4S5 6.797 5 9v3zm13 1.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 0 22.5v-9A1.5 1.5 0 0 1 1.5 12H2V9c0-3.844 3.156-7 7-7s7 3.156 7 7v3h.5a1.5 1.5 0 0 1 1.5 1.5z"/></svg>

After

Width:  |  Height:  |  Size: 269 B

View File

@ -0,0 +1,136 @@
<?php
/**
* Shortcode: Download History - [download_history]
*
* @package EDD
* @category Template
*
* @since 3.0 Uses new `edd_get_orders()` function and associated helpers.
* Checks status on individual order items when determining download link visibility.
*/
if ( ! empty( $_GET['edd-verify-success'] ) ) : ?>
<p class="edd-account-verified edd_success">
<?php esc_html_e( 'Your account has been successfully verified!', 'easy-digital-downloads' ); ?>
</p>
<?php
endif;
/**
* This template is used to display the download history of the current user.
*/
$customer = edd_get_customer_by( 'user_id', get_current_user_id() );
$page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
if ( ! empty( $customer ) ) {
$orders = edd_get_orders(
array(
'customer_id' => $customer->id,
'number' => 20,
'offset' => 20 * ( intval( $page ) - 1 ),
'type' => 'sale',
'status__not_in' => array( 'trash', 'refunded', 'abandoned' ),
)
);
} else {
$orders = array();
}
if ( $orders ) :
do_action( 'edd_before_download_history' ); ?>
<table id="edd_user_history" class="edd-table">
<thead>
<tr class="edd_download_history_row">
<?php do_action( 'edd_download_history_header_start' ); ?>
<th class="edd_download_download_name"><?php esc_html_e( 'Download Name', 'easy-digital-downloads' ); ?></th>
<?php if ( ! edd_no_redownload() ) : ?>
<th class="edd_download_download_files"><?php esc_html_e( 'Files', 'easy-digital-downloads' ); ?></th>
<?php endif; //End if no redownload?>
<?php do_action( 'edd_download_history_header_end' ); ?>
</tr>
</thead>
<?php
foreach ( $orders as $order ) :
foreach ( $order->get_items_with_bundles() as $key => $item ) :
?>
<tr class="edd_download_history_row">
<?php
$name = $item->product_name;
$price_id = $item->price_id;
$download_files = edd_get_download_files( $item->product_id, $price_id );
do_action( 'edd_download_history_row_start', $order->id, $item->product_id );
?>
<td class="edd_download_download_name"><?php echo esc_html( $name ); ?></td>
<?php if ( ! edd_no_redownload() ) : ?>
<td class="edd_download_download_files">
<?php
if ( $item->is_deliverable() ) :
if ( $download_files ) :
foreach ( $download_files as $filekey => $file ) :
$download_url = edd_get_download_file_url( $order->payment_key, $order->email, $filekey, $item->product_id, $price_id );
?>
<div class="edd_download_file">
<a href="<?php echo esc_url( $download_url ); ?>" class="edd_download_file_link">
<?php echo esc_html( edd_get_file_name( $file ) ); ?>
</a>
</div>
<?php
do_action( 'edd_download_history_download_file', $filekey, $file, $item, $order );
endforeach;
else :
esc_html_e( 'No downloadable files found.', 'easy-digital-downloads' );
endif; // End if payment complete
else : ?>
<span class="edd_download_payment_status">
<?php
printf(
/* translators: the order item's status. */
esc_html__( 'Status: %s', 'easy-digital-downloads' ),
esc_html( edd_get_status_label( $item->status ) )
);
?>
</span>
<?php
endif; // End if $download_files
?>
</td>
<?php endif; // End if ! edd_no_redownload()
do_action( 'edd_download_history_row_end', $order->id, $item->product_id );
?>
</tr>
<?php
endforeach; // End foreach get_items()
endforeach;
?>
</table>
<?php
if ( ! empty( $customer->id ) ) {
$count = edd_count_orders(
array(
'customer_id' => $customer->id,
'type' => 'sale',
'status__not_in' => array( 'trash', 'refunded', 'abandoned' ),
)
);
echo edd_pagination(
array(
'type' => 'download_history',
'total' => ceil( $count / 20 ), // 20 items per page
)
);
}
?>
<?php do_action( 'edd_after_download_history' ); ?>
<?php else : ?>
<p class="edd-no-downloads"><?php esc_html_e( 'You have not purchased any downloads', 'easy-digital-downloads' ); ?></p>
<?php endif; ?>

View File

@ -0,0 +1,104 @@
<?php
/**
* Shortcode: Purchase History - [purchase_history]
*
* @package EDD
* @category Template
*
* @since 3.0 Allow details link to appear for `partially_refunded` orders.
*/
if ( ! empty( $_GET['edd-verify-success'] ) ) : ?>
<p class="edd-account-verified edd_success">
<?php esc_html_e( 'Your account has been successfully verified!', 'easy-digital-downloads' ); ?>
</p>
<?php
endif;
/**
* This template is used to display the purchase history of the current user.
*/
if ( ! is_user_logged_in() ) {
return;
}
$page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
$user_id = get_current_user_id();
$orders = edd_get_orders(
array(
'user_id' => $user_id,
'number' => 20,
'offset' => 20 * ( intval( $page ) - 1 ),
'type' => 'sale',
'status__not_in' => array( 'trash' ),
)
);
/**
* Fires before the order history, whether or not orders have been found.
*
* @since 3.0
* @param array $orders The array of order objects for the current user.
* @param int $user_id The current user ID.
*/
do_action( 'edd_pre_order_history', $orders, $user_id );
if ( $orders ) :
do_action( 'edd_before_order_history', $orders );
?>
<table id="edd_user_history" class="edd-table">
<thead>
<tr class="edd_purchase_row">
<?php do_action( 'edd_purchase_history_header_before' ); ?>
<th class="edd_purchase_id"><?php esc_html_e( 'ID', 'easy-digital-downloads' ); ?></th>
<th class="edd_purchase_date"><?php esc_html_e( 'Date', 'easy-digital-downloads' ); ?></th>
<th class="edd_purchase_amount"><?php esc_html_e( 'Amount', 'easy-digital-downloads' ); ?></th>
<th class="edd_purchase_details"><?php esc_html_e( 'Details', 'easy-digital-downloads' ); ?></th>
<?php do_action( 'edd_purchase_history_header_after' ); ?>
</tr>
</thead>
<?php foreach ( $orders as $order ) : ?>
<tr class="edd_purchase_row">
<?php do_action( 'edd_order_history_row_start', $order ); ?>
<td class="edd_purchase_id">#<?php echo esc_html( $order->get_number() ); ?></td>
<td class="edd_purchase_date"><?php echo esc_html( edd_date_i18n( EDD()->utils->date( $order->date_created, null, true )->toDateTimeString() ) ); ?></td>
<td class="edd_purchase_amount">
<span class="edd_purchase_amount"><?php echo esc_html( edd_display_amount( $order->total, $order->currency ) ); ?></span>
</td>
<td class="edd_purchase_details">
<?php
if ( ! in_array( $order->status, array( 'complete', 'partially_refunded' ), true ) ) : ?>
<span class="edd_purchase_status <?php echo esc_html( $order->status ); ?>"><?php echo esc_html( edd_get_status_label( $order->status ) ); ?></span>
<?php
$recovery_url = $order->get_recovery_url();
if ( $recovery_url ) :
?>
&mdash; <a href="<?php echo esc_url( $recovery_url ); ?>"><?php esc_html_e( 'Complete Purchase', 'easy-digital-downloads' ); ?></a>
<?php
endif;
?>
<?php else: ?>
<a href="<?php echo esc_url( edd_get_receipt_page_uri( $order->id ) ); ?>"><?php esc_html_e( 'View Details and Downloads', 'easy-digital-downloads' ); ?></a>
<?php endif; ?>
</td>
<?php do_action( 'edd_order_history_row_end', $order ); ?>
</tr>
<?php endforeach; ?>
</table>
<?php
$count = edd_count_orders(
array(
'user_id' => get_current_user_id(),
'type' => 'sale',
)
);
echo edd_pagination(
array(
'type' => 'purchase_history',
'total' => ceil( $count / 20 ), // 20 items per page
)
);
do_action( 'edd_after_order_history', $orders );
?>
<?php else : ?>
<p class="edd-no-purchases"><?php esc_html_e( 'You have not made any purchases.', 'easy-digital-downloads' ); ?></p>
<?php
endif;

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View File

@ -0,0 +1,5 @@
<div id="edd-payment-processing">
<p><?php printf( __( 'Your purchase is processing. This page will reload automatically in 8 seconds. If it does not, click <a href="%s">here</a>.', 'easy-digital-downloads' ), esc_url( edd_get_success_page_uri() ) ); ?>
<span class="edd-cart-ajax"><span class="edd-icon-spinner edd-icon-spin"></span></span>
<script type="text/javascript">setTimeout(function(){ window.location = '<?php echo esc_url( edd_get_success_page_uri() ); ?>'; }, 8000);</script>
</div>

View File

@ -0,0 +1,3 @@
<div class="edd_download_buy_button">
<?php echo edd_get_purchase_link( array( 'download_id' => get_the_ID() ) ); ?>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* Shortcode "Excerpt" template.
*
* @since 1.2
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 2.0
* @version 3.0 Uses the new `edd_download_shortcode_except()` function
*/
?>
<div class="edd_download_excerpt">
<?php echo edd_download_shortcode_excerpt(); ?>
</div>

View File

@ -0,0 +1,17 @@
<?php
/**
* Shortcode "Full Content" template.
*
* @since 1.2
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 2.0
* @version 3.0 Uses the new `edd_download_shortcode_full_content()` function.
*/
?>
<div class="edd_download_full_content">
<?php echo edd_download_shortcode_full_content(); ?>
</div>

View File

@ -0,0 +1,7 @@
<?php if ( has_post_thumbnail( get_the_ID() ) ) : ?>
<div class="edd_download_image">
<a href="<?php the_permalink(); ?>">
<?php echo get_the_post_thumbnail( get_the_ID(), 'thumbnail' ); ?>
</a>
</div>
<?php endif; ?>

View File

@ -0,0 +1,7 @@
<?php if ( ! edd_has_variable_prices( get_the_ID() ) ) : ?>
<div>
<div class="edd_price">
<?php edd_price( get_the_ID() ); ?>
</div>
</div>
<?php endif; ?>

View File

@ -0,0 +1 @@
<h3 class="edd_download_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>

View File

@ -0,0 +1,54 @@
<?php
/**
* A single download inside of the [downloads] shortcode.
*
* @since 2.8.0
*
* @package EDD
* @category Template
* @author Easy Digital Downloads
* @version 1.0.0
*/
global $edd_download_shortcode_item_atts, $edd_download_shortcode_item_i;
?>
<div class="<?php echo esc_attr( apply_filters( 'edd_download_class', 'edd_download', get_the_ID(), $edd_download_shortcode_item_atts, $edd_download_shortcode_item_i ) ); ?>" id="edd_download_<?php the_ID(); ?>">
<div class="<?php echo esc_attr( apply_filters( 'edd_download_inner_class', 'edd_download_inner', get_the_ID(), $edd_download_shortcode_item_atts, $edd_download_shortcode_item_i ) ); ?>">
<?php
do_action( 'edd_download_before' );
if ( 'false' !== $edd_download_shortcode_item_atts['thumbnails'] ) :
edd_get_template_part( 'shortcode', 'content-image' );
do_action( 'edd_download_after_thumbnail' );
endif;
edd_get_template_part( 'shortcode', 'content-title' );
do_action( 'edd_download_after_title' );
if ( 'yes' === $edd_download_shortcode_item_atts['excerpt'] && 'yes' !== $edd_download_shortcode_item_atts['full_content'] ) :
edd_get_template_part( 'shortcode', 'content-excerpt' );
do_action( 'edd_download_after_content' );
elseif ( 'yes' === $edd_download_shortcode_item_atts['full_content'] ) :
edd_get_template_part( 'shortcode', 'content-full' );
do_action( 'edd_download_after_content' );
endif;
if ( 'yes' === $edd_download_shortcode_item_atts['price'] ) :
edd_get_template_part( 'shortcode', 'content-price' );
do_action( 'edd_download_after_price' );
endif;
if ( 'yes' === $edd_download_shortcode_item_atts['buy_button'] ) :
edd_get_template_part( 'shortcode', 'content-cart-button' );
endif;
do_action( 'edd_download_after' );
?>
</div>
</div>

View File

@ -0,0 +1,43 @@
<?php
/**
* This template is used to display the login form with [edd_login]
*/
global $edd_login_redirect;
if ( ! is_user_logged_in() ) :
// Show any error messages after form submission
edd_print_errors(); ?>
<form id="edd_login_form" class="edd_form" action="" method="post">
<fieldset>
<legend><?php _e( 'Log into Your Account', 'easy-digital-downloads' ); ?></legend>
<?php do_action( 'edd_login_fields_before' ); ?>
<p class="edd-login-username">
<label for="edd_user_login"><?php _e( 'Username or Email', 'easy-digital-downloads' ); ?></label>
<input name="edd_user_login" id="edd_user_login" class="edd-required edd-input" type="text"/>
</p>
<p class="edd-login-password">
<label for="edd_user_pass"><?php _e( 'Password', 'easy-digital-downloads' ); ?></label>
<input name="edd_user_pass" id="edd_user_pass" class="edd-password edd-required edd-input" type="password"/>
</p>
<p class="edd-login-remember">
<label><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e( 'Remember Me', 'easy-digital-downloads' ); ?></label>
</p>
<p class="edd-login-submit">
<input type="hidden" name="edd_redirect" value="<?php echo esc_url( $edd_login_redirect ); ?>"/>
<input type="hidden" name="edd_login_nonce" value="<?php echo esc_attr( wp_create_nonce( 'edd-login-nonce' ) ); ?>"/>
<input type="hidden" name="edd_action" value="user_login"/>
<input id="edd_login_submit" type="submit" class="edd-submit" value="<?php _e( 'Log In', 'easy-digital-downloads' ); ?>"/>
</p>
<p class="edd-lost-password">
<a href="<?php echo esc_url( edd_get_lostpassword_url() ); ?>">
<?php _e( 'Lost Password?', 'easy-digital-downloads' ); ?>
</a>
</p>
<?php do_action( 'edd_login_fields_after' ); ?>
</fieldset>
</form>
<?php else : ?>
<?php do_action( 'edd_login_form_logged_in' ); ?>
<?php endif; ?>

View File

@ -0,0 +1,234 @@
<?php
/**
* This template is used to display the profile editor with [edd_profile_editor]
*/
global $current_user;
if ( is_user_logged_in() ):
$user_id = get_current_user_id();
$first_name = get_user_meta( $user_id, 'first_name', true );
$last_name = get_user_meta( $user_id, 'last_name', true );
$display_name = $current_user->display_name;
$address = edd_get_customer_address( $user_id );
$states = edd_get_shop_states( $address['country'] );
$state = $address['state'];
if ( edd_is_cart_saved() ): ?>
<?php $restore_url = add_query_arg( array( 'edd_action' => 'restore_cart', 'edd_cart_token' => urlencode( edd_get_cart_token() ) ), edd_get_checkout_uri() ); ?>
<div class="edd_success edd-alert edd-alert-success"><strong><?php _e( 'Saved cart','easy-digital-downloads' ); ?>:</strong> <?php printf( __( 'You have a saved cart, <a href="%s">click here</a> to restore it.', 'easy-digital-downloads' ), esc_url( $restore_url ) ); ?></div>
<?php endif; ?>
<?php if ( isset( $_GET['updated'] ) && $_GET['updated'] == true && ! edd_get_errors() ): ?>
<div class="edd_success edd-alert edd-alert-success"><strong><?php _e( 'Success','easy-digital-downloads' ); ?>:</strong> <?php _e( 'Your profile has been edited successfully.', 'easy-digital-downloads' ); ?></div>
<?php endif; ?>
<?php edd_print_errors(); ?>
<?php do_action( 'edd_profile_editor_before' ); ?>
<form id="edd_profile_editor_form" class="edd_form" action="<?php echo esc_url( edd_get_current_page_url() ); ?>" method="post">
<?php do_action( 'edd_profile_editor_fields_top' ); ?>
<fieldset id="edd_profile_personal_fieldset">
<legend id="edd_profile_name_label"><?php _e( 'Change your Name', 'easy-digital-downloads' ); ?></legend>
<p id="edd_profile_first_name_wrap">
<label for="edd_first_name"><?php _e( 'First Name', 'easy-digital-downloads' ); ?></label>
<input name="edd_first_name" id="edd_first_name" class="text edd-input" type="text" value="<?php echo esc_attr( $first_name ); ?>" />
</p>
<p id="edd_profile_last_name_wrap">
<label for="edd_last_name"><?php _e( 'Last Name', 'easy-digital-downloads' ); ?></label>
<input name="edd_last_name" id="edd_last_name" class="text edd-input" type="text" value="<?php echo esc_attr( $last_name ); ?>" />
</p>
<p id="edd_profile_display_name_wrap">
<label for="edd_display_name"><?php _e( 'Display Name', 'easy-digital-downloads' ); ?></label>
<select name="edd_display_name" id="edd_display_name" class="select edd-select">
<?php if ( ! empty( $current_user->first_name ) ): ?>
<option <?php selected( $display_name, $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->first_name ); ?>"><?php echo esc_html( $current_user->first_name ); ?></option>
<?php endif; ?>
<option <?php selected( $display_name, $current_user->user_nicename ); ?> value="<?php echo esc_attr( $current_user->user_nicename ); ?>"><?php echo esc_html( $current_user->user_nicename ); ?></option>
<?php if ( ! empty( $current_user->last_name ) ): ?>
<option <?php selected( $display_name, $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->last_name ); ?>"><?php echo esc_html( $current_user->last_name ); ?></option>
<?php endif; ?>
<?php if ( ! empty( $current_user->first_name ) && ! empty( $current_user->last_name ) ): ?>
<option <?php selected( $display_name, $current_user->first_name . ' ' . $current_user->last_name ); ?> value="<?php echo esc_attr( $current_user->first_name . ' ' . $current_user->last_name ); ?>"><?php echo esc_html( $current_user->first_name . ' ' . $current_user->last_name ); ?></option>
<option <?php selected( $display_name, $current_user->last_name . ' ' . $current_user->first_name ); ?> value="<?php echo esc_attr( $current_user->last_name . ' ' . $current_user->first_name ); ?>"><?php echo esc_html( $current_user->last_name . ' ' . $current_user->first_name ); ?></option>
<?php endif; ?>
</select>
<?php do_action( 'edd_profile_editor_name' ); ?>
</p>
<?php do_action( 'edd_profile_editor_after_name' ); ?>
<p id="edd_profile_primary_email_wrap">
<label for="edd_email"><?php _e( 'Primary Email Address', 'easy-digital-downloads' ); ?></label>
<?php $customer = new EDD_Customer( $user_id, true ); ?>
<?php if ( $customer->id > 0 ) : ?>
<?php if ( 1 === count( $customer->emails ) ) : ?>
<input name="edd_email" id="edd_email" class="text edd-input required" type="email" value="<?php echo esc_attr( $customer->email ); ?>" />
<?php else: ?>
<?php
$emails = array();
$customer->emails = array_reverse( $customer->emails, true );
foreach ( $customer->emails as $email ) {
$emails[ $email ] = $email;
}
$email_select_args = array(
'options' => $emails,
'name' => 'edd_email',
'id' => 'edd_email',
'selected' => $customer->email,
'show_option_none' => false,
'show_option_all' => false,
);
echo EDD()->html->select( $email_select_args );
?>
<?php endif; ?>
<?php else: ?>
<input name="edd_email" id="edd_email" class="text edd-input required" type="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" />
<?php endif; ?>
<?php do_action( 'edd_profile_editor_email' ); ?>
</p>
<?php if ( $customer->id > 0 && count( $customer->emails ) > 1 ) : ?>
<p id="edd_profile_emails_wrap">
<label for="edd_emails"><?php _e( 'Additional Email Addresses', 'easy-digital-downloads' ); ?></label>
<ul class="edd-profile-emails">
<?php foreach ( $customer->emails as $email ) : ?>
<?php if ( $email === $customer->email ) { continue; } ?>
<li class="edd-profile-email">
<?php echo esc_html( $email ); ?>
<span class="actions">
<?php
$remove_url = wp_nonce_url(
add_query_arg(
array(
'email' => rawurlencode( $email ),
'edd_action' => 'profile-remove-email',
'redirect' => esc_url( edd_get_current_page_url() ),
)
),
'edd-remove-customer-email'
);
?>
<a href="<?php echo esc_url( $remove_url ); ?>" class="delete"><?php esc_html_e( 'Remove', 'easy-digital-downloads' ); ?></a>
</span>
</li>
<?php endforeach; ?>
</ul>
</p>
<?php endif; ?>
<?php do_action( 'edd_profile_editor_after_email' ); ?>
</fieldset>
<?php do_action( 'edd_profile_editor_after_personal_fields' ); ?>
<fieldset id="edd_profile_address_fieldset">
<legend id="edd_profile_billing_address_label"><?php _e( 'Change your Billing Address', 'easy-digital-downloads' ); ?></legend>
<p id="edd_profile_billing_address_line_1_wrap">
<label for="edd_address_line1"><?php _e( 'Line 1', 'easy-digital-downloads' ); ?></label>
<input name="edd_address_line1" id="edd_address_line1" class="text edd-input" type="text" value="<?php echo esc_attr( $address['line1'] ); ?>" />
</p>
<p id="edd_profile_billing_address_line_2_wrap">
<label for="edd_address_line2"><?php _e( 'Line 2', 'easy-digital-downloads' ); ?></label>
<input name="edd_address_line2" id="edd_address_line2" class="text edd-input" type="text" value="<?php echo esc_attr( $address['line2'] ); ?>" />
</p>
<p id="edd_profile_billing_address_city_wrap">
<label for="edd_address_city"><?php _e( 'City', 'easy-digital-downloads' ); ?></label>
<input name="edd_address_city" id="edd_address_city" class="text edd-input" type="text" value="<?php echo esc_attr( $address['city'] ); ?>" />
</p>
<p id="edd_profile_billing_address_postal_wrap">
<label for="edd_address_zip"><?php _e( 'Zip / Postal Code', 'easy-digital-downloads' ); ?></label>
<input name="edd_address_zip" id="edd_address_zip" class="text edd-input" type="text" value="<?php echo esc_attr( $address['zip'] ); ?>" />
</p>
<p id="edd_profile_billing_address_country_wrap">
<label for="edd_address_country"><?php _e( 'Country', 'easy-digital-downloads' ); ?></label>
<select name="edd_address_country" id="edd_address_country" class="select edd-select" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edd-country-field-nonce' ) ); ?>">
<?php foreach( edd_get_country_list() as $key => $country ) : ?>
<option value="<?php echo esc_attr( $key ); ?>"<?php selected( $address['country'], $key ); ?>><?php echo esc_html( $country ); ?></option>
<?php endforeach; ?>
</select>
</p>
<p id="edd_profile_billing_address_state_wrap">
<label for="edd_address_state"><?php _e( 'State / Province', 'easy-digital-downloads' ); ?></label>
<?php if( ! empty( $states ) ) : ?>
<select name="edd_address_state" id="edd_address_state" class="select edd-select">
<?php
foreach( $states as $state_code => $state_name ) {
echo '<option value="' . esc_attr( $state_code ) . '"' . selected( $state_code, $state, false ) . '>' . esc_html( $state_name ) . '</option>';
}
?>
</select>
<?php else : ?>
<input name="edd_address_state" id="edd_address_state" class="text edd-input" type="text" value="<?php echo esc_attr( $state ); ?>" />
<?php endif; ?>
<?php do_action( 'edd_profile_editor_address' ); ?>
</p>
<?php do_action( 'edd_profile_editor_after_address' ); ?>
</fieldset>
<?php do_action( 'edd_profile_editor_after_address_fields' ); ?>
<fieldset id="edd_profile_password_fieldset">
<legend id="edd_profile_password_label"><?php _e( 'Change your Password', 'easy-digital-downloads' ); ?></legend>
<p id="edd_profile_password_wrap">
<label for="edd_new_user_pass1"><?php esc_html_e( 'New Password', 'easy-digital-downloads' ); ?></label>
<input name="edd_new_user_pass1" id="edd_new_user_pass1" class="password edd-input" type="password"/>
</p>
<p id="edd_profile_confirm_password_wrap">
<label for="edd_new_user_pass2"><?php esc_html_e( 'Re-enter Password', 'easy-digital-downloads' ); ?></label>
<input name="edd_new_user_pass2" id="edd_new_user_pass2" class="password edd-input" type="password"/>
<?php do_action( 'edd_profile_editor_password' ); ?>
</p>
<?php do_action( 'edd_profile_editor_after_password' ); ?>
</fieldset>
<?php do_action( 'edd_profile_editor_after_password_fields' ); ?>
<fieldset id="edd_profile_submit_fieldset">
<p id="edd_profile_submit_wrap">
<input type="hidden" name="edd_profile_editor_nonce" value="<?php echo esc_attr( wp_create_nonce( 'edd-profile-editor-nonce' ) ); ?>"/>
<input type="hidden" name="edd_action" value="edit_user_profile" />
<input type="hidden" name="edd_redirect" value="<?php echo esc_url( edd_get_current_page_url() ); ?>" />
<input name="edd_profile_editor_submit" id="edd_profile_editor_submit" type="submit" class="edd_submit edd-submit" value="<?php _e( 'Save Changes', 'easy-digital-downloads' ); ?>"/>
</p>
</fieldset>
<?php do_action( 'edd_profile_editor_fields_bottom' ); ?>
</form><!-- #edd_profile_editor_form -->
<?php do_action( 'edd_profile_editor_after' ); ?>
<?php
else:
do_action( 'edd_profile_editor_logged_out' );
endif;

View File

@ -0,0 +1,335 @@
<?php
/**
* Shortcode: Receipt - [edd_receipt]
*
* @package EDD
* @category Template
*
* @since 3.0 Check status of order item when showing download link, instead of order itself.
* Show "Refunded" next to any refunded order items.
*/
global $edd_receipt_args;
$order = edd_get_order( $edd_receipt_args['id'] );
// 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;
/**
* 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, $edd_receipt_args );
?>
<table id="edd_purchase_receipt" class="edd-table">
<thead>
<?php do_action( 'edd_order_receipt_before', $order, $edd_receipt_args ); ?>
<?php if ( filter_var( $edd_receipt_args['payment_id'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
<tr>
<th><strong><?php echo esc_html_x( 'Order', 'heading', 'easy-digital-downloads' ); ?>:</strong></th>
<th><?php echo esc_html( $order->get_number() ); ?></th>
</tr>
<?php endif; ?>
</thead>
<tbody>
<tr>
<td class="edd_receipt_payment_status"><strong><?php esc_html_e( 'Order Status', 'easy-digital-downloads' ); ?>:</strong></td>
<td class="edd_receipt_payment_status <?php echo esc_attr( strtolower( $order->status ) ); ?>"><?php echo esc_html( edd_get_status_label( $order->status ) ); ?></td>
</tr>
<?php if ( filter_var( $edd_receipt_args['payment_key'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
<tr>
<td><strong><?php esc_html_e( 'Payment Key', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo esc_html( $order->payment_key ); ?></td>
</tr>
<?php endif; ?>
<?php if ( filter_var( $edd_receipt_args['payment_method'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
<tr>
<td><strong><?php esc_html_e( 'Payment Method', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo esc_html( edd_get_gateway_checkout_label( $order->gateway ) ); ?></td>
</tr>
<?php endif; ?>
<?php if ( filter_var( $edd_receipt_args['date'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
<tr>
<td><strong><?php esc_html_e( 'Date', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo esc_html( edd_date_i18n( EDD()->utils->date( $order->date_created, null, true )->toDateTimeString() ) ); ?></td>
</tr>
<?php endif; ?>
<?php if ( filter_var( $edd_receipt_args['price'], FILTER_VALIDATE_BOOLEAN ) && $order->subtotal > 0 ) : ?>
<tr>
<td><strong><?php esc_html_e( 'Subtotal', 'easy-digital-downloads' ); ?>:</strong></td>
<td>
<?php echo esc_html( edd_payment_subtotal( $order->id ) ); ?>
</td>
</tr>
<?php endif; ?>
<?php
if ( filter_var( $edd_receipt_args['discount'], FILTER_VALIDATE_BOOLEAN ) ) :
$order_discounts = $order->get_discounts();
if ( $order_discounts ) :
$label = _n( 'Discount', 'Discounts', count( $order_discounts ), 'easy-digital-downloads' );
?>
<tr>
<td colspan="2"><strong><?php echo esc_html( $label ); ?>:</strong></td>
</tr>
<?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 .= "&nbsp;({$rate})";
}
?>
<tr>
<td><?php echo esc_html( $label ); ?></td>
<td><?php echo esc_html( edd_display_amount( edd_negate_amount( $order_discount->total ), $order->currency ) ); ?></td>
</tr>
<?php
}
?>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php
$fees = $order->get_fees();
if ( ! empty( $fees ) ) :
?>
<tr>
<td colspan="2"><strong><?php echo esc_html( _n( 'Fee', 'Fees', count( $fees ), 'easy-digital-downloads' ) ); ?>:</strong></td>
</tr>
<?php
foreach ( $fees as $fee ) :
$label = __( 'Fee', 'easy-digital-downloads' );
if ( ! empty( $fee->description ) ) {
$label = $fee->description;
}
?>
<tr>
<td><span class="edd_fee_label"><?php echo esc_html( $label ); ?></span></td>
<td><span class="edd_fee_amount"><?php echo esc_html( edd_display_amount( $fee->subtotal, $order->currency ) ); ?></span></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
<?php if ( $order->tax > 0 ) : ?>
<tr>
<td><strong><?php esc_html_e( 'Tax', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo esc_html( edd_payment_tax( $order->id ) ); ?></td>
</tr>
<?php endif; ?>
<?php
$credits = $order->get_credits();
if ( $credits ) {
?>
<tr>
<td colspan="2"><strong><?php echo esc_html( _n( 'Credit', 'Credits', count( $credits ), 'easy-digital-downloads' ) ); ?>:</strong></td>
</tr>
<?php
foreach ( $credits as $credit ) {
$label = __( 'Credit', 'easy-digital-downloads' );
if ( ! empty( $credit->description ) ) {
$label = $credit->description;
}
?>
<tr>
<td><?php echo esc_html( $label ); ?></td>
<td><?php echo esc_html( edd_display_amount( edd_negate_amount( $credit->total ), $order->currency ) ); ?></td>
</tr>
<?php
}
}
?>
<?php if ( filter_var( $edd_receipt_args['price'], FILTER_VALIDATE_BOOLEAN ) ) : ?>
<tr>
<td><strong><?php esc_html_e( 'Total', 'easy-digital-downloads' ); ?>:</strong></td>
<td><?php echo esc_html( edd_payment_amount( $order->id ) ); ?></td>
</tr>
<?php endif; ?>
<?php
/**
* Fires at the end of the order receipt `tbody`.
*
* @since 3.0
* @param \EDD\Orders\Order $order Current order.
* @param array $edd_receipt_args [edd_receipt] shortcode arguments.
*/
do_action( 'edd_order_receipt_after', $order, $edd_receipt_args );
?>
</tbody>
</table>
<?php
/**
* Fires after the order 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_after_table', $order, $edd_receipt_args );
if ( ! filter_var( $edd_receipt_args['products'], FILTER_VALIDATE_BOOLEAN ) ) {
return;
}
$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>
<table id="edd_purchase_receipt_products" class="edd-table">
<thead>
<th><?php esc_html_e( 'Name', 'easy-digital-downloads' ); ?></th>
<?php if ( edd_use_skus() ) { ?>
<th><?php esc_html_e( 'SKU', 'easy-digital-downloads' ); ?></th>
<?php } ?>
<?php if ( edd_item_quantities_enabled() ) : ?>
<th><?php esc_html_e( 'Quantity', 'easy-digital-downloads' ); ?></th>
<?php endif; ?>
<th><?php esc_html_e( 'Price', 'easy-digital-downloads' ); ?></th>
</thead>
<tbody>
<?php foreach ( $order_items as $key => $item ) : ?>
<?php
// Skip this item if we can't view it.
if ( ! apply_filters( 'edd_user_can_view_receipt_item', true, $item ) ) {
continue;
}
?>
<tr>
<td>
<?php $download_files = edd_get_download_files( $item->product_id, $item->price_id ); ?>
<div class="edd_purchase_receipt_product_name">
<?php
echo esc_html( $item->product_name );
if ( ! empty( $item->status ) && 'complete' !== $item->status ) {
echo ' &ndash; ' . 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; ?>
<?php if ( 'refunded' !== $item->status && edd_receipt_show_download_files( $item->product_id, $edd_receipt_args, $item ) ) : ?>
<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>
<?php endif; ?>
<?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 );
?>
</td>
<?php if ( edd_use_skus() ) : ?>
<td><?php echo esc_html( edd_get_download_sku( $item->product_id ) ); ?></td>
<?php endif; ?>
<?php if ( edd_item_quantities_enabled() ) { ?>
<td><?php echo esc_html( $item->quantity ); ?></td>
<?php } ?>
<td>
<?php echo esc_html( edd_display_amount( $item->total, $order->currency ) ); ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

View File

@ -0,0 +1,59 @@
<?php
/**
* This template is used to display the registration form with [edd_register]
*/
global $edd_register_redirect;
do_action( 'edd_print_errors' ); ?>
<?php if ( ! is_user_logged_in() ) : ?>
<form id="edd_register_form" class="edd_form" action="" method="post">
<?php do_action( 'edd_register_form_fields_top' ); ?>
<fieldset>
<legend><?php _e( 'Register New Account', 'easy-digital-downloads' ); ?></legend>
<?php do_action( 'edd_register_form_fields_before' ); ?>
<p>
<label for="edd-user-login"><?php _e( 'Username', 'easy-digital-downloads' ); ?></label>
<input id="edd-user-login" class="required edd-input" type="text" name="edd_user_login" />
</p>
<p>
<label for="edd-user-email"><?php _e( 'Email', 'easy-digital-downloads' ); ?></label>
<input id="edd-user-email" class="required edd-input" type="email" name="edd_user_email" />
</p>
<p>
<label for="edd-user-pass"><?php _e( 'Password', 'easy-digital-downloads' ); ?></label>
<input id="edd-user-pass" class="password required edd-input" type="password" name="edd_user_pass" />
</p>
<p>
<label for="edd-user-pass2"><?php _e( 'Confirm Password', 'easy-digital-downloads' ); ?></label>
<input id="edd-user-pass2" class="password required edd-input" type="password" name="edd_user_pass2" />
</p>
<?php do_action( 'edd_register_form_fields_before_submit' ); ?>
<p>
<input type="hidden" name="edd_honeypot" value="" />
<input type="hidden" name="edd_action" value="user_register" />
<input type="hidden" name="edd_redirect" value="<?php echo esc_url( $edd_register_redirect ); ?>"/>
<input class="edd-submit" name="edd_register_submit" type="submit" value="<?php esc_attr_e( 'Register', 'easy-digital-downloads' ); ?>" />
</p>
<?php do_action( 'edd_register_form_fields_after' ); ?>
</fieldset>
<?php do_action( 'edd_register_form_fields_bottom' ); ?>
</form>
<?php else : ?>
<?php do_action( 'edd_register_form_logged_in' ); ?>
<?php endif; ?>

View File

@ -0,0 +1,6 @@
<?php if ( edd_use_taxes() ) : ?>
<li class="cart_item edd-cart-meta edd_subtotal"><?php echo __( 'Subtotal:', 'easy-digital-downloads' ). " <span class='subtotal'>" . edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ); ?></span></li>
<li class="cart_item edd-cart-meta edd_cart_tax"><?php _e( 'Estimated Tax:', 'easy-digital-downloads' ); ?> <span class="cart-tax"><?php echo edd_currency_filter( edd_format_amount( edd_get_cart_tax() ) ); ?></span></li>
<?php endif; ?>
<li class="cart_item edd-cart-meta edd_total"><?php _e( 'Total:', 'easy-digital-downloads' ); ?> <span class="cart-total"><?php echo edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ); ?></span></li>
<li class="cart_item edd_checkout"><a href="<?php echo esc_url( edd_get_checkout_uri() ); ?>"><?php esc_html_e( 'Checkout', 'easy-digital-downloads' ); ?></a></li>

View File

@ -0,0 +1,7 @@
<li class="cart_item empty"><?php echo edd_empty_cart_message(); ?></li>
<?php if ( edd_use_taxes() ) : ?>
<li class="cart_item edd-cart-meta edd_subtotal" style="display:none;"><?php echo __( 'Subtotal:', 'easy-digital-downloads' ). " <span class='subtotal'>" . edd_currency_filter( edd_format_amount( edd_get_cart_subtotal() ) ); ?></span></li>
<li class="cart_item edd-cart-meta edd_cart_tax" style="display:none;"><?php _e( 'Estimated Tax:', 'easy-digital-downloads' ); ?> <span class="cart-tax"><?php echo edd_currency_filter( edd_format_amount( edd_get_cart_tax() ) ); ?></span></li>
<?php endif; ?>
<li class="cart_item edd-cart-meta edd_total" style="display:none;"><?php _e( 'Total:', 'easy-digital-downloads' ); ?> <span class="cart-total"><?php echo edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ); ?></span></li>
<li class="cart_item edd_checkout" style="display:none;"><a href="<?php echo esc_url( edd_get_checkout_uri() ); ?>"><?php _e( 'Checkout', 'easy-digital-downloads' ); ?></a></li>

View File

@ -0,0 +1,5 @@
<li class="edd-cart-item">
<span class="edd-cart-item-title">{item_title}</span>
<span class="edd-cart-item-separator">-</span>&nbsp;<?php echo edd_item_quantities_enabled() ? '<span class="edd-cart-item-quantity">{item_quantity}&nbsp;@&nbsp;</span>' : ''; ?><span class="edd-cart-item-price">{item_amount}</span>&nbsp;<span class="edd-cart-item-separator">-</span>
<a href="{remove_url}" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edd-remove-cart-widget-item' ) ); ?>" data-cart-item="{cart_item_id}" data-download-id="{item_id}" data-action="edd_remove_from_cart" class="edd-remove-from-cart"><?php _e( 'remove', 'easy-digital-downloads' ); ?></a>
</li>

View File

@ -0,0 +1,26 @@
<?php
/**
* This template is used to display the Downloads cart widget.
*/
$cart_items = edd_get_cart_contents();
$cart_quantity = edd_get_cart_quantity();
$display = $cart_quantity > 0 ? '' : ' style="display:none;"';
?>
<p class="edd-cart-number-of-items"<?php echo $display; ?>><?php _e( 'Number of items in cart', 'easy-digital-downloads' ); ?>: <span class="edd-cart-quantity"><?php echo esc_html( $cart_quantity ); ?></span></p>
<ul class="edd-cart">
<?php if( $cart_items ) : ?>
<?php foreach( $cart_items as $key => $item ) : ?>
<?php echo edd_get_cart_item_template( $key, $item, false ); ?>
<?php endforeach; ?>
<?php edd_get_template_part( 'widget', 'cart-checkout' ); ?>
<?php else : ?>
<?php edd_get_template_part( 'widget', 'cart-empty' ); ?>
<?php endif; ?>
</ul>