installed plugin Easy Digital Downloads
version 3.1.0.3
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-footer 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' ); ?>
|
||||
<div class="edd_cart_discount">
|
||||
<?php edd_cart_discounts_html(); ?>
|
||||
</div>
|
||||
<?php do_action( 'edd_checkout_table_discount_last' ); ?>
|
||||
</div>
|
@ -0,0 +1,24 @@
|
||||
<?php foreach ( edd_get_cart_fees() as $fee_id => $fee ) : ?>
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-footer edd_cart_fee" id="edd_cart_fee_<?php echo esc_attr( $fee_id ); ?>">
|
||||
|
||||
<?php do_action( 'edd_cart_fee_rows_before', $fee_id, $fee ); ?>
|
||||
|
||||
<div class="edd_cart_fee_label"><?php echo esc_html( $fee['label'] ); ?></div>
|
||||
<div class="edd_cart_fee_amount">
|
||||
<?php echo esc_html( edd_currency_filter( edd_format_amount( $fee['amount'] ) ) ); ?>
|
||||
<?php if ( ! empty( $fee['type'] ) && 'item' === $fee['type'] ) : ?>
|
||||
<div class="edd_cart_actions">
|
||||
<a
|
||||
class="edd-blocks-cart__action-remove"
|
||||
href="<?php echo esc_url( edd_remove_cart_fee_url( $fee_id ) ); ?>"
|
||||
>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Remove', 'easy-digital-downloads' ); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'edd_cart_fee_rows_after', $fee_id, $fee ); ?>
|
||||
|
||||
</div>
|
||||
<?php endforeach;
|
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
$classes = array( 'edd-blocks-cart__row', 'edd-blocks-cart__row-footer', 'edd-blocks-cart__row-buttons', 'edd_cart_footer_row' );
|
||||
if ( edd_is_cart_saving_disabled() ) {
|
||||
$classes[] = 'edd-no-js';
|
||||
}
|
||||
?>
|
||||
<div class="<?php echo esc_attr( implode( ' ', $classes ) ); ?>">
|
||||
<?php do_action( 'edd_cart_footer_buttons' ); ?>
|
||||
</div>
|
@ -0,0 +1,59 @@
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-item 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'] ); ?>">
|
||||
<div class="edd_cart_item_name">
|
||||
<div class="edd_checkout_cart_item_title">
|
||||
<?php
|
||||
if ( 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>';
|
||||
}
|
||||
echo esc_html( edd_get_cart_item_name( $item ) );
|
||||
echo '</div>';
|
||||
/**
|
||||
* 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 );
|
||||
if ( $is_checkout_block && edd_item_quantities_enabled() && ! edd_download_quantities_disabled( $item['id'] ) ) :
|
||||
?>
|
||||
<div class="edd_cart_actions">
|
||||
<label for="edd-cart-download-<?php echo esc_attr( $key ); ?>-quantity"><?php esc_html_e( 'Quantity:', 'easy-digital-downloads' ); ?></label>
|
||||
<input type="number" min="1" step="1" name="edd-cart-download-<?php echo esc_attr( $key ); ?>-quantity" id="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'] ) ); ?>"/>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
</div>
|
||||
<div class="edd_cart_item_price">
|
||||
<?php
|
||||
echo wp_kses_post( edd_cart_item_price( $item['id'], $item['options'] ) );
|
||||
do_action( 'edd_checkout_cart_item_price_after', $item );
|
||||
$remove_url = edd_remove_item_url( $key );
|
||||
$button_class = 'edd-remove-from-cart';
|
||||
if ( empty( $is_cart_widget ) ) {
|
||||
$remove_url = wp_nonce_url( $remove_url, 'edd-remove-from-cart-' . sanitize_key( $key ), 'edd_remove_from_cart_nonce' );
|
||||
$button_class = 'edd_cart_remove_item_btn';
|
||||
}
|
||||
?>
|
||||
<div class="edd_cart_actions">
|
||||
<?php do_action( 'edd_cart_actions', $item, $key ); ?>
|
||||
<a
|
||||
class="edd-blocks-cart__action-remove <?php echo esc_attr( $button_class ); ?>"
|
||||
href="<?php echo esc_url( $remove_url ); ?>"
|
||||
<?php if ( ! empty( $is_cart_widget ) ) : ?>
|
||||
data-nonce="<?php echo esc_attr( wp_create_nonce( 'edd-remove-cart-widget-item' ) ); ?>"
|
||||
data-cart-item="<?php echo absint( $key ); ?>"
|
||||
data-download-id="<?php echo absint( $item['id'] ); ?>"
|
||||
data-action="edd_remove_from_cart"
|
||||
<?php endif; ?>
|
||||
>
|
||||
<span class="screen-reader-text"><?php esc_html_e( 'Remove', 'easy-digital-downloads' ); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,13 @@
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-footer 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' ); ?>
|
||||
<div class="edd_cart_subtotal">
|
||||
<?php esc_html_e( 'Subtotal', 'easy-digital-downloads' ); ?>: <span class="edd_cart_subtotal_amount"><?php echo edd_cart_subtotal(); // Escaped ?></span>
|
||||
</div>
|
||||
<?php do_action( 'edd_checkout_table_subtotal_last' ); ?>
|
||||
</div>
|
@ -0,0 +1,12 @@
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-footer 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' ); ?>
|
||||
<div class="edd_cart_tax">
|
||||
<?php esc_html_e( 'Tax', 'easy-digital-downloads' ); ?>: <span class="edd_cart_tax_amount" data-tax="<?php echo esc_attr( edd_get_cart_tax() ); ?>"><?php edd_cart_tax( true ); // Escaped ?></span>
|
||||
</div>
|
||||
<?php do_action( 'edd_checkout_table_tax_last' ); ?>
|
||||
</div>
|
@ -0,0 +1,10 @@
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-footer edd_cart_footer_row">
|
||||
<?php
|
||||
if ( $is_checkout_block ) {
|
||||
include EDD_BLOCKS_DIR . 'views/checkout/discount.php';
|
||||
}
|
||||
?>
|
||||
<div class="edd_cart_total">
|
||||
<?php esc_html_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>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,52 @@
|
||||
<form id="edd_checkout_cart_form" class="edd-blocks-form edd-blocks-form__cart" method="post">
|
||||
<?php
|
||||
$cart_classes = array(
|
||||
'edd-blocks-cart',
|
||||
'ajaxed',
|
||||
);
|
||||
$is_checkout_block = empty( $is_cart_widget ) && ( edd_is_checkout() || edd_doing_ajax() );
|
||||
?>
|
||||
<div id="edd_checkout_cart" class="<?php echo esc_attr( implode( ' ', $cart_classes ) ); ?>">
|
||||
<?php if ( edd_is_checkout() ) : ?>
|
||||
<div class="edd-blocks-cart__row edd-blocks-cart__row-header edd_cart_header_row">
|
||||
<div class="edd_cart_item_name"><?php esc_html_e( 'Item Name', 'easy-digital-downloads' ); ?></div>
|
||||
<div class="edd_cart_item_price"><?php esc_html_e( 'Item Price', 'easy-digital-downloads' ); ?></div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
do_action( 'edd_cart_items_before' );
|
||||
if ( $cart_items ) {
|
||||
?>
|
||||
<div class="edd-blocks-cart__items">
|
||||
<?php
|
||||
foreach ( $cart_items as $key => $item ) {
|
||||
include 'cart-item.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
do_action( 'edd_cart_items_middle' );
|
||||
if ( edd_cart_has_fees() ) {
|
||||
include 'cart-fees.php';
|
||||
}
|
||||
do_action( 'edd_cart_items_after' );
|
||||
|
||||
if ( edd_use_taxes() && ! edd_prices_include_tax() ) {
|
||||
include 'cart-subtotal.php';
|
||||
}
|
||||
|
||||
require 'cart-discounts.php';
|
||||
|
||||
if ( edd_use_taxes() ) {
|
||||
include 'cart-taxes.php';
|
||||
}
|
||||
|
||||
require 'cart-total.php';
|
||||
|
||||
if ( has_action( 'edd_cart_footer_buttons' ) ) {
|
||||
include 'cart-footer-row.php';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if ( ! empty( $block_attributes['link'] ) && ! edd_is_checkout() ) {
|
||||
?>
|
||||
<a href="<?php echo esc_url( edd_get_checkout_uri() ); ?>">
|
||||
<?php
|
||||
}
|
||||
require EDD_BLOCKS_DIR . 'assets/images/cart.svg';
|
||||
$output = array();
|
||||
if ( ! empty( $block_attributes['show_quantity'] ) ) {
|
||||
$output[] = '<span class="edd-blocks-cart__mini-quantity">' . \EDD\Blocks\Checkout\Functions\get_quantity_string() . '</span>';
|
||||
}
|
||||
if ( ! empty( $block_attributes['show_total'] ) ) {
|
||||
$output[] = '<span class="edd-blocks-cart__mini-total">' . edd_currency_filter( edd_format_amount( edd_get_cart_total() ) ) . '</span>';
|
||||
}
|
||||
if ( ! empty( $output ) ) {
|
||||
echo wp_kses_post( implode( ' - ', $output ) );
|
||||
}
|
||||
if ( ! empty( $block_attributes['link'] ) && ! edd_is_checkout() ) {
|
||||
?>
|
||||
</a>
|
||||
<?php
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
if ( isset( $_GET['payment-mode'] ) && edd_is_ajax_disabled() ) {
|
||||
return; // Only show before a payment method has been selected if ajax is disabled
|
||||
}
|
||||
|
||||
if ( ! edd_has_active_discounts() || ! edd_get_cart_total() ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div id="edd_discount_code" class="edd-blocks-cart__discount">
|
||||
<div id="edd_show_discount" class="edd-has-js">
|
||||
<button class="edd-button-secondary edd_discount_link"><?php esc_html_e( 'Enter a discount code', 'easy-digital-downloads' ); ?></button>
|
||||
</div>
|
||||
<div id="edd-discount-code-wrap" class="edd-cart-adjustment edd-no-js">
|
||||
<label class="screen-reader-text" for="edd-discount">
|
||||
<?php esc_html_e( 'Discount', 'easy-digital-downloads' ); ?>
|
||||
</label>
|
||||
<span class="edd-discount-code-field-wrap">
|
||||
<input class="edd-input" type="text" id="edd-discount" name="edd-discount" placeholder="<?php esc_html_e( 'Enter discount code', 'easy-digital-downloads' ); ?>"/>
|
||||
<input type="submit" class="edd-apply-discount edd-submit wp-block-button__link" value="<?php echo esc_html( _x( 'Apply', 'Apply discount at checkout', 'easy-digital-downloads' ) ); ?>"/>
|
||||
</span>
|
||||
<span class="edd-discount-loader edd-loading" id="edd-discount-loader" style="display:none;"></span>
|
||||
<span id="edd-discount-error-wrap" class="edd_error edd-alert edd-alert-error" aria-hidden="true" style="display:none;"></span>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,13 @@
|
||||
<p>
|
||||
<strong><?php esc_html_e( 'Account Information', 'easy-digital-downloads' ); ?>:</strong>
|
||||
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1. The current user's email address; 2. opening anchor tag, do not translate; 3. closing anchor tag, do not translate. */
|
||||
__( 'You are currently logged in as %1$s. (%2$slog out%3$s)', 'easy-digital-downloads' ),
|
||||
esc_html( $customer['email'] ),
|
||||
'<a href="' . esc_url( wp_logout_url( edd_get_current_page_url() ) ) . '">',
|
||||
'</a>'
|
||||
);
|
||||
?>
|
||||
</p>
|
@ -0,0 +1,111 @@
|
||||
<?php use EDD\Blocks\Functions; ?>
|
||||
<fieldset id="edd_cc_address" class="edd-blocks-form cc-address">
|
||||
<legend><?php esc_html_e( 'Billing Address', 'easy-digital-downloads' ); ?></legend>
|
||||
<?php do_action( 'edd_cc_billing_top' ); ?>
|
||||
<div id="edd-card-country-wrap" class="edd-blocks-form__group edd-blocks-form__group-country">
|
||||
<label for="billing_country" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'Country', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'billing_country' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<select name="billing_country" id="billing_country" data-nonce="<?php echo esc_attr( wp_create_nonce( 'edd-country-field-nonce' ) ); ?>" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'billing_country', array( 'edd-select' ) ) ) ); ?>"<?php Functions\mark_field_required( 'billing_country' ); ?>>
|
||||
<?php
|
||||
$selected_country = edd_get_shop_country();
|
||||
|
||||
if ( ! empty( $customer['address']['country'] ) && '*' !== $customer['address']['country'] ) {
|
||||
$selected_country = $customer['address']['country'];
|
||||
}
|
||||
|
||||
$countries = edd_get_country_list();
|
||||
foreach ( $countries as $country_code => $country ) {
|
||||
echo '<option value="' . esc_attr( $country_code ) . '"' . selected( $country_code, $selected_country, false ) . '>' . esc_html( $country ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div id="edd-card-address-wrap" class="edd-blocks-form__group edd-blocks-form__group-address">
|
||||
<label for="card_address" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'Address', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'card_address' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<input type="text" id="card_address" name="card_address" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'card_address', array( 'edd-input' ) ) ) ); ?>" placeholder="<?php esc_html_e( 'Address line 1', 'easy-digital-downloads' ); ?>" value="<?php echo esc_attr( $customer['address']['line1'] ); ?>"<?php Functions\mark_field_required( 'card_address' ); ?>/>
|
||||
</div>
|
||||
<div id="edd-card-address-2-wrap" class="edd-blocks-form__group edd-blocks-form__group-address2">
|
||||
<label for="card_address_2" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'Address Line 2', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'card_address_2' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<input type="text" id="card_address_2" name="card_address_2" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'card_address_2', array( 'edd-input' ) ) ) ); ?>" placeholder="<?php esc_html_e( 'Address line 2', 'easy-digital-downloads' ); ?>" value="<?php echo esc_attr( $customer['address']['line2'] ); ?>"<?php Functions\mark_field_required( 'card_address_2' ); ?>/>
|
||||
</div>
|
||||
<div id="edd-card-city-wrap" class="edd-blocks-form__group edd-blocks-form__group-city">
|
||||
<label for="card_city" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'City', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'card_city' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<input type="text" id="card_city" name="card_city" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'card_city', array( 'edd-input' ) ) ) ); ?>" placeholder="<?php esc_html_e( 'City', 'easy-digital-downloads' ); ?>" value="<?php echo esc_attr( $customer['address']['city'] ); ?>"<?php Functions\mark_field_required( 'card_city' ); ?>/>
|
||||
</div>
|
||||
<div class="edd-blocks-form__halves">
|
||||
<div id="edd-card-state-wrap" class="edd-blocks-form__group edd-blocks-form__group-state">
|
||||
<label for="card_state" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'State/Province', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'card_state' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<?php
|
||||
$selected_state = edd_get_shop_state();
|
||||
$states = edd_get_shop_states( $selected_country );
|
||||
|
||||
if ( ! empty( $customer['address']['state'] ) ) {
|
||||
$selected_state = $customer['address']['state'];
|
||||
}
|
||||
|
||||
if ( ! empty( $states ) ) :
|
||||
?>
|
||||
<select name="card_state" id="card_state" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'card_state', array( 'edd-select' ) ) ) ); ?>"<?php Functions\mark_field_required( 'card_state' ); ?>>
|
||||
<?php
|
||||
foreach ( $states as $state_code => $state ) {
|
||||
echo '<option value="' . esc_attr( $state_code ) . '"' . selected( $state_code, $selected_state, false ) . '>' . esc_html( $state ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php
|
||||
else :
|
||||
$customer_state = ! empty( $customer['address']['state'] ) ? $customer['address']['state'] : '';
|
||||
?>
|
||||
<input type="text" name="card_state" id="card_state" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'card_state', array( 'edd-input' ) ) ) ); ?>" value="<?php echo esc_attr( $customer_state ); ?>" placeholder="<?php esc_html_e( 'State/Province', 'easy-digital-downloads' ); ?>"<?php Functions\mark_field_required( 'card_state' ); ?>/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="edd-card-zip-wrap" class="edd-blocks-form__group edd-blocks-form__group-zip">
|
||||
<label for="card_zip" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'ZIP/Postal Code', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'card_zip' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<input type="text" id="card_zip" name="card_zip" class="<?php echo esc_attr( implode( ' ', Functions\get_input_classes( 'card_zip', array( 'edd-input' ) ) ) ); ?>" placeholder="<?php esc_html_e( 'Zip / Postal Code', 'easy-digital-downloads' ); ?>" value="<?php echo esc_attr( $customer['address']['zip'] ); ?>"<?php Functions\mark_field_required( 'card_zip' ); ?>/>
|
||||
</div>
|
||||
</div>
|
||||
<?php do_action( 'edd_cc_billing_bottom' ); ?>
|
||||
<?php wp_nonce_field( 'edd-checkout-address-fields', 'edd-checkout-address-fields-nonce', false, true ); ?>
|
||||
</fieldset>
|
||||
<?php
|
@ -0,0 +1,76 @@
|
||||
<fieldset id="edd_cc_fields" class="edd-do-validate edd-blocks-form">
|
||||
<legend><?php esc_html_e( 'Credit Card Info', 'easy-digital-downloads' ); ?></legend>
|
||||
<?php if ( is_ssl() ) : ?>
|
||||
<div id="edd_secure_site_wrapper">
|
||||
<?php
|
||||
echo edd_get_payment_icon(
|
||||
array(
|
||||
'icon' => 'lock',
|
||||
'width' => 16,
|
||||
'height' => 16,
|
||||
'title' => __( 'Secure SSL encrypted payment', 'easy-digital-downloads' ),
|
||||
'classes' => array( 'edd-icon', 'edd-icon-lock' ),
|
||||
)
|
||||
);
|
||||
?>
|
||||
<span><?php esc_html_e( 'This is a secure SSL encrypted payment.', 'easy-digital-downloads' ); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div id="edd-card-name-wrap" class="edd-blocks-form__group edd-blocks-form__group-card--name">
|
||||
<label for="card_name" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'Name on the Card', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<input type="text" autocomplete="off" name="card_name" id="card_name" class="card-name edd-input required" placeholder="<?php _e( 'Card name', 'easy-digital-downloads' ); ?>" />
|
||||
</div>
|
||||
<div id="edd-card-number-wrap" class="edd-blocks-form__group edd-blocks-form__group-card--number">
|
||||
<label for="card_number" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'Card Number', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
<span class="card-type"></span>
|
||||
</label>
|
||||
<input type="tel" pattern="^[0-9!@#$%^&* ]*$" autocomplete="off" name="card_number" id="card_number" class="card-number edd-input required" placeholder="<?php esc_html_e( 'Card number', 'easy-digital-downloads' ); ?>" />
|
||||
</div>
|
||||
<div class="edd-blocks-form__halves">
|
||||
<div id="edd-card-cvc-wrap" class="edd-blocks-form__group edd-blocks-form__group-card--cvc">
|
||||
<label for="card_cvc" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'CVC', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<input type="tel" pattern="[0-9]{3,4}" size="4" maxlength="4" autocomplete="off" name="card_cvc" id="card_cvc" class="card-cvc edd-input required" placeholder="<?php _e( 'Security code', 'easy-digital-downloads' ); ?>" />
|
||||
</div>
|
||||
<?php do_action( 'edd_before_cc_expiration' ); ?>
|
||||
<div class="card-expiration" class="edd-blocks-form__group edd-blocks-form__group-card--expiration">
|
||||
<label for="card_exp_month" class="edd-label">
|
||||
<?php
|
||||
esc_html_e( 'Expiration (MM/YY)', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<select id="card_exp_month" name="card_exp_month" class="card-expiry-month edd-select edd-select-small required">
|
||||
<?php
|
||||
for ( $i = 1; $i <= 12; $i++ ) {
|
||||
echo '<option value="' . absint( $i ) . '">' . sprintf( '%02d', absint( $i ) ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span class="exp-divider">/</span>
|
||||
<select id="card_exp_year" name="card_exp_year" class="card-expiry-year edd-select edd-select-small required">
|
||||
<?php
|
||||
$year = gmdate( 'Y' );
|
||||
for ( $i = $year; $i <= $year + 30; $i++ ) {
|
||||
echo '<option value="' . absint( $i ) . '">' . esc_html( substr( $i, 2 ) ) . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<?php do_action( 'edd_after_cc_expiration' ); ?>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
@ -0,0 +1,57 @@
|
||||
<div id="edd_payment_mode_select_wrap">
|
||||
<?php do_action( 'edd_payment_mode_top' ); ?>
|
||||
|
||||
<?php if ( edd_is_ajax_disabled() ) { ?>
|
||||
<form id="edd_payment_mode" action="<?php echo esc_url( edd_get_current_page_url() ); ?>" method="GET">
|
||||
<?php } ?>
|
||||
|
||||
<fieldset id="edd_payment_mode_select">
|
||||
<legend><?php esc_html_e( 'Select Payment Method', 'easy-digital-downloads' ); ?></legend>
|
||||
<?php do_action( 'edd_payment_mode_before_gateways_wrap' ); ?>
|
||||
<div id="edd-payment-mode-wrap">
|
||||
<?php
|
||||
do_action( 'edd_payment_mode_before_gateways' );
|
||||
|
||||
$gateways = edd_get_enabled_payment_gateways( true );
|
||||
$payment_icons = EDD\Blocks\Checkout\Gateways\get_payment_icons();
|
||||
$default = edd_get_option( 'default_gateway' );
|
||||
foreach ( $gateways as $gateway_id => $gateway ) {
|
||||
$checked = $gateway_id === $default ? 'checked' : checked( $gateway_id, $payment_mode, false );
|
||||
$class = 'edd-gateway-option';
|
||||
if ( $checked ) {
|
||||
$class .= ' edd-gateway-option-selected';
|
||||
}
|
||||
|
||||
?>
|
||||
<label for="edd-gateway-<?php echo esc_attr( $gateway_id ); ?>" class="<?php echo esc_attr( $class ); ?>" id="edd-gateway-option-<?php echo esc_attr( $gateway_id ); ?>">
|
||||
<input type="radio" name="payment-mode" class="edd-gateway" id="edd-gateway-<?php echo esc_attr( $gateway_id ); ?>" value="<?php echo esc_attr( $gateway_id ); ?>" data-<?php echo esc_attr( $gateway_id ); ?>-nonce="<?php echo esc_attr( wp_create_nonce( 'edd-gateway-selected-' . esc_attr( $gateway_id ) ) ); ?>" autocomplete="off" <?php echo esc_attr( $checked ); ?>>
|
||||
<?php
|
||||
echo esc_html( apply_filters( 'edd_gateway_checkout_label_' . $gateway_id, $gateway['checkout_label'] ) );
|
||||
if ( $payment_icons ) {
|
||||
$gateway_icons = EDD\Blocks\Checkout\Gateways\get_gateway_icons( $gateway_id, $gateway );
|
||||
if ( $gateway_icons ) {
|
||||
EDD\Blocks\Checkout\Gateways\do_payment_icons( $payment_icons, $gateway_icons );
|
||||
}
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<?php
|
||||
}
|
||||
|
||||
do_action( 'edd_payment_mode_after_gateways' );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'edd_payment_mode_after_gateways_wrap' ); ?>
|
||||
</fieldset>
|
||||
|
||||
<div id="edd_payment_mode_submit" class="edd-no-js">
|
||||
<input type="hidden" name="edd_action" value="gateway_select" />
|
||||
<input type="hidden" name="page_id" value="<?php echo absint( edd_get_current_page_url() ); ?>"/>
|
||||
<input type="submit" name="gateway_submit" id="edd_next_button" class="edd-submit" value="<?php esc_html_e( 'Next', 'easy-digital-downloads' ); ?>"/>
|
||||
</div>
|
||||
|
||||
<?php if ( edd_is_ajax_disabled() ) : ?>
|
||||
</form>
|
||||
<?php endif; ?>
|
||||
</div>
|
@ -0,0 +1,14 @@
|
||||
<?php
|
||||
if ( function_exists( 'EDD_CFM' ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<?php if ( ! empty( $customer['email'] ) ) : ?>
|
||||
<input type="hidden" name="edd_email" id="edd-email" value="<?php echo esc_attr( $customer['email'] ); ?>" required/>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! empty( $customer['first_name'] ) ) : ?>
|
||||
<input type="hidden" name="edd_first" id="edd-first" value="<?php echo esc_attr( $customer['first_name'] ); ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php if ( ! empty( $customer['last_name'] ) ) : ?>
|
||||
<input type="hidden" name="edd_last" id="edd-last" value="<?php echo esc_attr( $customer['last_name'] ); ?>"/>
|
||||
<?php endif; ?>
|
@ -0,0 +1,29 @@
|
||||
<fieldset id="edd_login_fields" class="edd-blocks-form">
|
||||
<legend><?php esc_html_e( 'Log Into Your Account', 'easy-digital-downloads' ); ?></legend>
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-username">
|
||||
<label for="edd_user_login">
|
||||
<?php
|
||||
esc_html_e( 'Username or Email', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<div class="edd-blocks-form__control">
|
||||
<input name="edd_user_login" id="edd_user_login" class="edd-required edd-input" type="text" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-password">
|
||||
<label for="edd_user_pass">
|
||||
<?php
|
||||
esc_html_e( 'Password', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<div class="edd-blocks-form__control">
|
||||
<input name="edd_user_pass" id="edd_user_pass" class="edd-password edd-required edd-input" type="password" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div id="edd-user-login-submit">
|
||||
<input type="submit" class="<?php echo esc_attr( implode( ' ', EDD\Blocks\Functions\get_button_classes() ) ); ?>" name="edd_login_submit" value="<?php esc_html_e( 'Log in', 'easy-digital-downloads' ); ?>"/>
|
||||
<?php wp_nonce_field( 'edd-login-form', 'edd_login_nonce', false, true ); ?>
|
||||
</div>
|
||||
</fieldset>
|
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
if ( function_exists( 'EDD_CFM' ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<fieldset id="edd_checkout_user_info" class="edd-blocks-form">
|
||||
<legend><?php esc_html_e( 'Personal Info', 'easy-digital-downloads' ); ?></legend>
|
||||
<?php if ( empty( $customer['email'] ) ) : ?>
|
||||
<div id="edd-email-wrap">
|
||||
<label class="edd-label" for="edd-email">
|
||||
<?php
|
||||
esc_html_e( 'Email address', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<input class="edd-input required" type="email" name="edd_email" placeholder="<?php esc_html_e( 'Email address', 'easy-digital-downloads' ); ?>" id="edd-email" value="<?php echo esc_attr( $customer['email'] ); ?>" aria-describedby="edd-email-description" required/>
|
||||
<p class="edd-description" id="edd-email-description"><?php esc_html_e( 'We will send the purchase receipt to this address.', 'easy-digital-downloads' ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( empty( $customer['first_name'] ) ) : ?>
|
||||
<div id="edd-first-name-wrap">
|
||||
<label class="edd-label" for="edd-first">
|
||||
<?php
|
||||
esc_html_e( 'First name', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'edd_first' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<input class="edd-input required" type="text" name="edd_first" placeholder="<?php esc_html_e( 'First name', 'easy-digital-downloads' ); ?>" id="edd-first" value="<?php echo esc_attr( $customer['first_name'] ); ?>" aria-describedby="edd-first-description" <?php EDD\Blocks\Functions\mark_field_required( 'edd_first' ); ?>/>
|
||||
<p class="edd-description" id="edd-first-description"><?php esc_html_e( 'We will use this to personalize your account experience.', 'easy-digital-downloads' ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ( empty( $customer['last_name'] ) ) : ?>
|
||||
<div id="edd-last-name-wrap">
|
||||
<label class="edd-label" for="edd-last">
|
||||
<?php
|
||||
esc_html_e( 'Last name', 'easy-digital-downloads' );
|
||||
if ( edd_field_is_required( 'edd_last' ) ) {
|
||||
echo EDD()->html->show_required();
|
||||
}
|
||||
?>
|
||||
</label>
|
||||
<input class="edd-input" type="text" name="edd_last" id="edd-last" placeholder="<?php esc_html_e( 'Last name', 'easy-digital-downloads' ); ?>" value="<?php echo esc_attr( $customer['last_name'] ); ?>" aria-describedby="edd-last-description" <?php EDD\Blocks\Functions\mark_field_required( 'edd_last' ); ?>/>
|
||||
<p class="edd-description" id="edd-last-description"><?php esc_html_e( 'We will use this as well to personalize your account experience.', 'easy-digital-downloads' ); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</fieldset>
|
@ -0,0 +1,38 @@
|
||||
<?php require 'personal-info.php'; ?>
|
||||
<fieldset class="edd-blocks-form">
|
||||
<legend><?php esc_html_e( 'Register For a New Account', 'easy-digital-downloads' ); ?></legend>
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-username">
|
||||
<label for="edd_user_register">
|
||||
<?php
|
||||
esc_html_e( 'Username', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<div class="edd-blocks-form__control">
|
||||
<input name="edd_user_login" id="edd_user_register" class="edd-required edd-input" type="text" required/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-password">
|
||||
<label for="edd-user-pass">
|
||||
<?php
|
||||
esc_html_e( 'Password', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<div class="edd-blocks-form__control">
|
||||
<input id="edd-user-pass" class="password required edd-input" type="password" name="edd_user_pass" required />
|
||||
</div>
|
||||
</div>
|
||||
<div class="edd-blocks-form__group edd-blocks-form__group-password-confirm">
|
||||
<label for="edd-user-pass2">
|
||||
<?php
|
||||
esc_html_e( 'Confirm Password', 'easy-digital-downloads' );
|
||||
echo EDD()->html->show_required();
|
||||
?>
|
||||
</label>
|
||||
<div class="edd-blocks-form__control">
|
||||
<input id="edd-user-pass2" class="password required edd-input" type="password" name="edd_user_pass_confirm" required />
|
||||
</div>
|
||||
<input type="hidden" name="edd-purchase-var" value="needs-to-register"/>
|
||||
</div>
|
||||
</fieldset>
|
Reference in New Issue
Block a user