initial commit
This commit is contained in:
25
templates/checkout/cart-errors.php
Normal file
25
templates/checkout/cart-errors.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* Cart errors page
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/cart-errors.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
|
||||
<p><?php esc_html_e( 'There are some issues with the items in your cart. Please go back to the cart page and resolve these issues before checking out.', 'woocommerce' ); ?></p>
|
||||
|
||||
<?php do_action( 'woocommerce_cart_has_errors' ); ?>
|
||||
|
||||
<p><a class="button wc-backward" href="<?php echo esc_url( wc_get_cart_url() ); ?>"><?php esc_html_e( 'Return to cart', 'woocommerce' ); ?></a></p>
|
74
templates/checkout/form-billing.php
Normal file
74
templates/checkout/form-billing.php
Normal file
@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout billing information form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-billing.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
* @global WC_Checkout $checkout
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
<div class="woocommerce-billing-fields">
|
||||
<?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
|
||||
|
||||
<h3><?php esc_html_e( 'Billing & Shipping', 'woocommerce' ); ?></h3>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<h3><?php esc_html_e( 'Billing details', 'woocommerce' ); ?></h3>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
|
||||
|
||||
<div class="woocommerce-billing-fields__field-wrapper">
|
||||
<?php
|
||||
$fields = $checkout->get_checkout_fields( 'billing' );
|
||||
|
||||
foreach ( $fields as $key => $field ) {
|
||||
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?>
|
||||
</div>
|
||||
|
||||
<?php if ( ! is_user_logged_in() && $checkout->is_registration_enabled() ) : ?>
|
||||
<div class="woocommerce-account-fields">
|
||||
<?php if ( ! $checkout->is_registration_required() ) : ?>
|
||||
|
||||
<p class="form-row form-row-wide create-account">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
|
||||
<input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true ); ?> type="checkbox" name="createaccount" value="1" /> <span><?php esc_html_e( 'Create an account?', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?>
|
||||
|
||||
<?php if ( $checkout->get_checkout_fields( 'account' ) ) : ?>
|
||||
|
||||
<div class="create-account">
|
||||
<?php foreach ( $checkout->get_checkout_fields( 'account' ) as $key => $field ) : ?>
|
||||
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
|
||||
<?php endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
66
templates/checkout/form-checkout.php
Normal file
66
templates/checkout/form-checkout.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout Form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_before_checkout_form', $checkout );
|
||||
|
||||
// If checkout registration is disabled and not logged in, the user cannot checkout.
|
||||
if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
|
||||
echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) ) );
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
|
||||
|
||||
<?php if ( $checkout->get_checkout_fields() ) : ?>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
|
||||
|
||||
<div class="col2-set" id="customer_details">
|
||||
<div class="col-1">
|
||||
<?php do_action( 'woocommerce_checkout_billing' ); ?>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<?php do_action( 'woocommerce_checkout_shipping' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_before_order_review_heading' ); ?>
|
||||
|
||||
<h3 id="order_review_heading"><?php esc_html_e( 'Your order', 'woocommerce' ); ?></h3>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
|
||||
|
||||
<div id="order_review" class="woocommerce-checkout-review-order">
|
||||
<?php do_action( 'woocommerce_checkout_order_review' ); ?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
|
||||
|
||||
</form>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>
|
42
templates/checkout/form-coupon.php
Normal file
42
templates/checkout/form-coupon.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout coupon form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.4.4
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! wc_coupons_enabled() ) { // @codingStandardsIgnoreLine.
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="woocommerce-form-coupon-toggle">
|
||||
<?php wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', esc_html__( 'Have a coupon?', 'woocommerce' ) . ' <a href="#" class="showcoupon">' . esc_html__( 'Click here to enter your code', 'woocommerce' ) . '</a>' ), 'notice' ); ?>
|
||||
</div>
|
||||
|
||||
<form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none">
|
||||
|
||||
<p><?php esc_html_e( 'If you have a coupon code, please apply it below.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="form-row form-row-first">
|
||||
<input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
|
||||
</p>
|
||||
|
||||
<p class="form-row form-row-last">
|
||||
<button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
|
||||
</p>
|
||||
|
||||
<div class="clear"></div>
|
||||
</form>
|
36
templates/checkout/form-login.php
Normal file
36
templates/checkout/form-login.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout login form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-login.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.8.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( is_user_logged_in() || 'no' === get_option( 'woocommerce_enable_checkout_login_reminder' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="woocommerce-form-login-toggle">
|
||||
<?php wc_print_notice( apply_filters( 'woocommerce_checkout_login_message', esc_html__( 'Returning customer?', 'woocommerce' ) ) . ' <a href="#" class="showlogin">' . esc_html__( 'Click here to login', 'woocommerce' ) . '</a>', 'notice' ); ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
woocommerce_login_form(
|
||||
array(
|
||||
'message' => esc_html__( 'If you have shopped with us before, please enter your details below. If you are a new customer, please proceed to the Billing section.', 'woocommerce' ),
|
||||
'redirect' => wc_get_checkout_url(),
|
||||
'hidden' => true,
|
||||
)
|
||||
);
|
98
templates/checkout/form-pay.php
Normal file
98
templates/checkout/form-pay.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* Pay for order form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-pay.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 5.2.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$totals = $order->get_order_item_totals(); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
?>
|
||||
<form id="order_review" method="post">
|
||||
|
||||
<table class="shop_table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
|
||||
<th class="product-quantity"><?php esc_html_e( 'Qty', 'woocommerce' ); ?></th>
|
||||
<th class="product-total"><?php esc_html_e( 'Totals', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if ( count( $order->get_items() ) > 0 ) : ?>
|
||||
<?php foreach ( $order->get_items() as $item_id => $item ) : ?>
|
||||
<?php
|
||||
if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
|
||||
continue;
|
||||
}
|
||||
?>
|
||||
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
|
||||
<td class="product-name">
|
||||
<?php
|
||||
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
|
||||
|
||||
wc_display_item_meta( $item );
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
|
||||
?>
|
||||
</td>
|
||||
<td class="product-quantity"><?php echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', esc_html( $item->get_quantity() ) ) . '</strong>', $item ); ?></td><?php // @codingStandardsIgnoreLine ?>
|
||||
<td class="product-subtotal"><?php echo $order->get_formatted_line_subtotal( $item ); ?></td><?php // @codingStandardsIgnoreLine ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<?php if ( $totals ) : ?>
|
||||
<?php foreach ( $totals as $total ) : ?>
|
||||
<tr>
|
||||
<th scope="row" colspan="2"><?php echo $total['label']; ?></th><?php // @codingStandardsIgnoreLine ?>
|
||||
<td class="product-total"><?php echo $total['value']; ?></td><?php // @codingStandardsIgnoreLine ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<div id="payment">
|
||||
<?php if ( $order->needs_payment() ) : ?>
|
||||
<ul class="wc_payment_methods payment_methods methods">
|
||||
<?php
|
||||
if ( ! empty( $available_gateways ) ) {
|
||||
foreach ( $available_gateways as $gateway ) {
|
||||
wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
|
||||
}
|
||||
} else {
|
||||
echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . apply_filters( 'woocommerce_no_available_payment_methods_message', esc_html__( 'Sorry, it seems that there are no available payment methods for your location. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) ) . '</li>'; // @codingStandardsIgnoreLine
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="woocommerce_pay" value="1" />
|
||||
|
||||
<?php wc_get_template( 'checkout/terms.php' ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_pay_order_before_submit' ); ?>
|
||||
|
||||
<?php echo apply_filters( 'woocommerce_pay_order_button_html', '<button type="submit" class="button alt" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<?php do_action( 'woocommerce_pay_order_after_submit' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'woocommerce-pay', 'woocommerce-pay-nonce' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
70
templates/checkout/form-shipping.php
Normal file
70
templates/checkout/form-shipping.php
Normal file
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout shipping information form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-shipping.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.6.0
|
||||
* @global WC_Checkout $checkout
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
<div class="woocommerce-shipping-fields">
|
||||
<?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
|
||||
|
||||
<h3 id="ship-to-different-address">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
|
||||
<input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <span><?php esc_html_e( 'Ship to a different address?', 'woocommerce' ); ?></span>
|
||||
</label>
|
||||
</h3>
|
||||
|
||||
<div class="shipping_address">
|
||||
|
||||
<?php do_action( 'woocommerce_before_checkout_shipping_form', $checkout ); ?>
|
||||
|
||||
<div class="woocommerce-shipping-fields__field-wrapper">
|
||||
<?php
|
||||
$fields = $checkout->get_checkout_fields( 'shipping' );
|
||||
|
||||
foreach ( $fields as $key => $field ) {
|
||||
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php do_action( 'woocommerce_after_checkout_shipping_form', $checkout ); ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="woocommerce-additional-fields">
|
||||
<?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>
|
||||
|
||||
<?php if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) : ?>
|
||||
|
||||
<?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?>
|
||||
|
||||
<h3><?php esc_html_e( 'Additional information', 'woocommerce' ); ?></h3>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="woocommerce-additional-fields__field-wrapper">
|
||||
<?php foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) : ?>
|
||||
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
|
||||
</div>
|
46
templates/checkout/order-receipt.php
Normal file
46
templates/checkout/order-receipt.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout Order Receipt Template
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/order-receipt.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.2.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
<ul class="order_details">
|
||||
<li class="order">
|
||||
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?>
|
||||
<strong><?php echo esc_html( $order->get_order_number() ); ?></strong>
|
||||
</li>
|
||||
<li class="date">
|
||||
<?php esc_html_e( 'Date:', 'woocommerce' ); ?>
|
||||
<strong><?php echo esc_html( wc_format_datetime( $order->get_date_created() ) ); ?></strong>
|
||||
</li>
|
||||
<li class="total">
|
||||
<?php esc_html_e( 'Total:', 'woocommerce' ); ?>
|
||||
<strong><?php echo wp_kses_post( $order->get_formatted_order_total() ); ?></strong>
|
||||
</li>
|
||||
<?php if ( $order->get_payment_method_title() ) : ?>
|
||||
<li class="method">
|
||||
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?>
|
||||
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php do_action( 'woocommerce_receipt_' . $order->get_payment_method(), $order->get_id() ); ?>
|
||||
|
||||
<div class="clear"></div>
|
33
templates/checkout/payment-method.php
Normal file
33
templates/checkout/payment-method.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Output a single payment method
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/payment-method.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<li class="wc_payment_method payment_method_<?php echo esc_attr( $gateway->id ); ?>">
|
||||
<input id="payment_method_<?php echo esc_attr( $gateway->id ); ?>" type="radio" class="input-radio" name="payment_method" value="<?php echo esc_attr( $gateway->id ); ?>" <?php checked( $gateway->chosen, true ); ?> data-order_button_text="<?php echo esc_attr( $gateway->order_button_text ); ?>" />
|
||||
|
||||
<label for="payment_method_<?php echo esc_attr( $gateway->id ); ?>">
|
||||
<?php echo $gateway->get_title(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?> <?php echo $gateway->get_icon(); /* phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped */ ?>
|
||||
</label>
|
||||
<?php if ( $gateway->has_fields() || $gateway->get_description() ) : ?>
|
||||
<div class="payment_box payment_method_<?php echo esc_attr( $gateway->id ); ?>" <?php if ( ! $gateway->chosen ) : /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>style="display:none;"<?php endif; /* phpcs:ignore Squiz.ControlStructures.ControlSignature.NewlineAfterOpenBrace */ ?>>
|
||||
<?php $gateway->payment_fields(); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</li>
|
61
templates/checkout/payment.php
Normal file
61
templates/checkout/payment.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout Payment Section
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/payment.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.5.3
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! is_ajax() ) {
|
||||
do_action( 'woocommerce_review_order_before_payment' );
|
||||
}
|
||||
?>
|
||||
<div id="payment" class="woocommerce-checkout-payment">
|
||||
<?php if ( WC()->cart->needs_payment() ) : ?>
|
||||
<ul class="wc_payment_methods payment_methods methods">
|
||||
<?php
|
||||
if ( ! empty( $available_gateways ) ) {
|
||||
foreach ( $available_gateways as $gateway ) {
|
||||
wc_get_template( 'checkout/payment-method.php', array( 'gateway' => $gateway ) );
|
||||
}
|
||||
} else {
|
||||
echo '<li class="woocommerce-notice woocommerce-notice--info woocommerce-info">' . apply_filters( 'woocommerce_no_available_payment_methods_message', WC()->customer->get_billing_country() ? esc_html__( 'Sorry, it seems that there are no available payment methods for your state. Please contact us if you require assistance or wish to make alternate arrangements.', 'woocommerce' ) : esc_html__( 'Please fill in your details above to see available payment methods.', 'woocommerce' ) ) . '</li>'; // @codingStandardsIgnoreLine
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<div class="form-row place-order">
|
||||
<noscript>
|
||||
<?php
|
||||
/* translators: $1 and $2 opening and closing emphasis tags respectively */
|
||||
printf( esc_html__( 'Since your browser does not support JavaScript, or it is disabled, please ensure you click the %1$sUpdate Totals%2$s button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'woocommerce' ), '<em>', '</em>' );
|
||||
?>
|
||||
<br/><button type="submit" class="button alt" name="woocommerce_checkout_update_totals" value="<?php esc_attr_e( 'Update totals', 'woocommerce' ); ?>"><?php esc_html_e( 'Update totals', 'woocommerce' ); ?></button>
|
||||
</noscript>
|
||||
|
||||
<?php wc_get_template( 'checkout/terms.php' ); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_review_order_before_submit' ); ?>
|
||||
|
||||
<?php echo apply_filters( 'woocommerce_order_button_html', '<button type="submit" class="button alt" name="woocommerce_checkout_place_order" id="place_order" value="' . esc_attr( $order_button_text ) . '" data-value="' . esc_attr( $order_button_text ) . '">' . esc_html( $order_button_text ) . '</button>' ); // @codingStandardsIgnoreLine ?>
|
||||
|
||||
<?php do_action( 'woocommerce_review_order_after_submit' ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'woocommerce-process_checkout', 'woocommerce-process-checkout-nonce' ); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if ( ! is_ajax() ) {
|
||||
do_action( 'woocommerce_review_order_after_payment' );
|
||||
}
|
110
templates/checkout/review-order.php
Normal file
110
templates/checkout/review-order.php
Normal file
@ -0,0 +1,110 @@
|
||||
<?php
|
||||
/**
|
||||
* Review order table
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/review-order.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 5.2.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
<table class="shop_table woocommerce-checkout-review-order-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
|
||||
<th class="product-total"><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
do_action( 'woocommerce_review_order_before_cart_contents' );
|
||||
|
||||
foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
|
||||
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
|
||||
|
||||
if ( $_product && $_product->exists() && $cart_item['quantity'] > 0 && apply_filters( 'woocommerce_checkout_cart_item_visible', true, $cart_item, $cart_item_key ) ) {
|
||||
?>
|
||||
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_cart_item_class', 'cart_item', $cart_item, $cart_item_key ) ); ?>">
|
||||
<td class="product-name">
|
||||
<?php echo wp_kses_post( apply_filters( 'woocommerce_cart_item_name', $_product->get_name(), $cart_item, $cart_item_key ) ) . ' '; ?>
|
||||
<?php echo apply_filters( 'woocommerce_checkout_cart_item_quantity', ' <strong class="product-quantity">' . sprintf( '× %s', $cart_item['quantity'] ) . '</strong>', $cart_item, $cart_item_key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
<?php echo wc_get_formatted_cart_item_data( $cart_item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</td>
|
||||
<td class="product-total">
|
||||
<?php echo apply_filters( 'woocommerce_cart_item_subtotal', WC()->cart->get_product_subtotal( $_product, $cart_item['quantity'] ), $cart_item, $cart_item_key ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_review_order_after_cart_contents' );
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
|
||||
<tr class="cart-subtotal">
|
||||
<th><?php esc_html_e( 'Subtotal', 'woocommerce' ); ?></th>
|
||||
<td><?php wc_cart_totals_subtotal_html(); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php foreach ( WC()->cart->get_coupons() as $code => $coupon ) : ?>
|
||||
<tr class="cart-discount coupon-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
|
||||
<th><?php wc_cart_totals_coupon_label( $coupon ); ?></th>
|
||||
<td><?php wc_cart_totals_coupon_html( $coupon ); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ( WC()->cart->needs_shipping() && WC()->cart->show_shipping() ) : ?>
|
||||
|
||||
<?php do_action( 'woocommerce_review_order_before_shipping' ); ?>
|
||||
|
||||
<?php wc_cart_totals_shipping_html(); ?>
|
||||
|
||||
<?php do_action( 'woocommerce_review_order_after_shipping' ); ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php foreach ( WC()->cart->get_fees() as $fee ) : ?>
|
||||
<tr class="fee">
|
||||
<th><?php echo esc_html( $fee->name ); ?></th>
|
||||
<td><?php wc_cart_totals_fee_html( $fee ); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if ( wc_tax_enabled() && ! WC()->cart->display_prices_including_tax() ) : ?>
|
||||
<?php if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) : ?>
|
||||
<?php foreach ( WC()->cart->get_tax_totals() as $code => $tax ) : // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited ?>
|
||||
<tr class="tax-rate tax-rate-<?php echo esc_attr( sanitize_title( $code ) ); ?>">
|
||||
<th><?php echo esc_html( $tax->label ); ?></th>
|
||||
<td><?php echo wp_kses_post( $tax->formatted_amount ); ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else : ?>
|
||||
<tr class="tax-total">
|
||||
<th><?php echo esc_html( WC()->countries->tax_or_vat() ); ?></th>
|
||||
<td><?php wc_cart_totals_taxes_total_html(); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_review_order_before_order_total' ); ?>
|
||||
|
||||
<tr class="order-total">
|
||||
<th><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
|
||||
<td><?php wc_cart_totals_order_total_html(); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php do_action( 'woocommerce_review_order_after_order_total' ); ?>
|
||||
|
||||
</tfoot>
|
||||
</table>
|
40
templates/checkout/terms.php
Normal file
40
templates/checkout/terms.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* Checkout terms and conditions area.
|
||||
*
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.4.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( apply_filters( 'woocommerce_checkout_show_terms', true ) && function_exists( 'wc_terms_and_conditions_checkbox_enabled' ) ) {
|
||||
do_action( 'woocommerce_checkout_before_terms_and_conditions' );
|
||||
|
||||
?>
|
||||
<div class="woocommerce-terms-and-conditions-wrapper">
|
||||
<?php
|
||||
/**
|
||||
* Terms and conditions hook used to inject content.
|
||||
*
|
||||
* @since 3.4.0.
|
||||
* @hooked wc_checkout_privacy_policy_text() Shows custom privacy policy text. Priority 20.
|
||||
* @hooked wc_terms_and_conditions_page_content() Shows t&c page content. Priority 30.
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_terms_and_conditions' );
|
||||
?>
|
||||
|
||||
<?php if ( wc_terms_and_conditions_checkbox_enabled() ) : ?>
|
||||
<p class="form-row validate-required">
|
||||
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
|
||||
<input type="checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" name="terms" <?php checked( apply_filters( 'woocommerce_terms_is_checked_default', isset( $_POST['terms'] ) ), true ); // WPCS: input var ok, csrf ok. ?> id="terms" />
|
||||
<span class="woocommerce-terms-and-conditions-checkbox-text"><?php wc_terms_and_conditions_checkbox_text(); ?></span> <span class="required">*</span>
|
||||
</label>
|
||||
<input type="hidden" name="terms-field" value="1" />
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
do_action( 'woocommerce_checkout_after_terms_and_conditions' );
|
||||
}
|
88
templates/checkout/thankyou.php
Normal file
88
templates/checkout/thankyou.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* Thankyou page
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php.
|
||||
*
|
||||
* HOWEVER, on occasion WooCommerce will need to update template files and you
|
||||
* (the theme developer) will need to copy the new files to your theme to
|
||||
* maintain compatibility. We try to do this as little as possible, but it does
|
||||
* happen. When this occurs the version of the template file will be bumped and
|
||||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 3.7.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
|
||||
<div class="woocommerce-order">
|
||||
|
||||
<?php
|
||||
if ( $order ) :
|
||||
|
||||
do_action( 'woocommerce_before_thankyou', $order->get_id() );
|
||||
?>
|
||||
|
||||
<?php if ( $order->has_status( 'failed' ) ) : ?>
|
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
|
||||
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a>
|
||||
<?php if ( is_user_logged_in() ) : ?>
|
||||
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a>
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||
|
||||
<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
|
||||
|
||||
<li class="woocommerce-order-overview__order order">
|
||||
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?>
|
||||
<strong><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li>
|
||||
|
||||
<li class="woocommerce-order-overview__date date">
|
||||
<?php esc_html_e( 'Date:', 'woocommerce' ); ?>
|
||||
<strong><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li>
|
||||
|
||||
<?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
|
||||
<li class="woocommerce-order-overview__email email">
|
||||
<?php esc_html_e( 'Email:', 'woocommerce' ); ?>
|
||||
<strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
<li class="woocommerce-order-overview__total total">
|
||||
<?php esc_html_e( 'Total:', 'woocommerce' ); ?>
|
||||
<strong><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong>
|
||||
</li>
|
||||
|
||||
<?php if ( $order->get_payment_method_title() ) : ?>
|
||||
<li class="woocommerce-order-overview__payment-method method">
|
||||
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?>
|
||||
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
|
||||
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
Reference in New Issue
Block a user