initial commit
This commit is contained in:
34
templates/order/form-tracking.php
Normal file
34
templates/order/form-tracking.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Order tracking form
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/form-tracking.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
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
global $post;
|
||||
?>
|
||||
|
||||
<form action="<?php echo esc_url( get_permalink( $post->ID ) ); ?>" method="post" class="woocommerce-form woocommerce-form-track-order track_order">
|
||||
|
||||
<p><?php esc_html_e( 'To track your order please enter your Order ID in the box below and press the "Track" button. This was given to you on your receipt and in the confirmation email you should have received.', 'woocommerce' ); ?></p>
|
||||
|
||||
<p class="form-row form-row-first"><label for="orderid"><?php esc_html_e( 'Order ID', 'woocommerce' ); ?></label> <input class="input-text" type="text" name="orderid" id="orderid" value="<?php echo isset( $_REQUEST['orderid'] ) ? esc_attr( wp_unslash( $_REQUEST['orderid'] ) ) : ''; ?>" placeholder="<?php esc_attr_e( 'Found in your order confirmation email.', 'woocommerce' ); ?>" /></p><?php // @codingStandardsIgnoreLine ?>
|
||||
<p class="form-row form-row-last"><label for="order_email"><?php esc_html_e( 'Billing email', 'woocommerce' ); ?></label> <input class="input-text" type="text" name="order_email" id="order_email" value="<?php echo isset( $_REQUEST['order_email'] ) ? esc_attr( wp_unslash( $_REQUEST['order_email'] ) ) : ''; ?>" placeholder="<?php esc_attr_e( 'Email you used during checkout.', 'woocommerce' ); ?>" /></p><?php // @codingStandardsIgnoreLine ?>
|
||||
<div class="clear"></div>
|
||||
|
||||
<p class="form-row"><button type="submit" class="button" name="track" value="<?php esc_attr_e( 'Track', 'woocommerce' ); ?>"><?php esc_html_e( 'Track', 'woocommerce' ); ?></button></p>
|
||||
<?php wp_nonce_field( 'woocommerce-order_tracking', 'woocommerce-order-tracking-nonce' ); ?>
|
||||
|
||||
</form>
|
23
templates/order/order-again.php
Normal file
23
templates/order/order-again.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* Order again button
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-again.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 class="order-again">
|
||||
<a href="<?php echo esc_url( $order_again_url ); ?>" class="button"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a>
|
||||
</p>
|
66
templates/order/order-details-customer.php
Normal file
66
templates/order/order-details-customer.php
Normal file
@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Customer Details
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-details-customer.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.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$show_shipping = ! wc_ship_to_billing_address_only() && $order->needs_shipping_address();
|
||||
?>
|
||||
<section class="woocommerce-customer-details">
|
||||
|
||||
<?php if ( $show_shipping ) : ?>
|
||||
|
||||
<section class="woocommerce-columns woocommerce-columns--2 woocommerce-columns--addresses col2-set addresses">
|
||||
<div class="woocommerce-column woocommerce-column--1 woocommerce-column--billing-address col-1">
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h2 class="woocommerce-column__title"><?php esc_html_e( 'Billing address', 'woocommerce' ); ?></h2>
|
||||
|
||||
<address>
|
||||
<?php echo wp_kses_post( $order->get_formatted_billing_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
|
||||
<?php if ( $order->get_billing_phone() ) : ?>
|
||||
<p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_billing_phone() ); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $order->get_billing_email() ) : ?>
|
||||
<p class="woocommerce-customer-details--email"><?php echo esc_html( $order->get_billing_email() ); ?></p>
|
||||
<?php endif; ?>
|
||||
</address>
|
||||
|
||||
<?php if ( $show_shipping ) : ?>
|
||||
|
||||
</div><!-- /.col-1 -->
|
||||
|
||||
<div class="woocommerce-column woocommerce-column--2 woocommerce-column--shipping-address col-2">
|
||||
<h2 class="woocommerce-column__title"><?php esc_html_e( 'Shipping address', 'woocommerce' ); ?></h2>
|
||||
<address>
|
||||
<?php echo wp_kses_post( $order->get_formatted_shipping_address( esc_html__( 'N/A', 'woocommerce' ) ) ); ?>
|
||||
|
||||
<?php if ( $order->get_shipping_phone() ) : ?>
|
||||
<p class="woocommerce-customer-details--phone"><?php echo esc_html( $order->get_shipping_phone() ); ?></p>
|
||||
<?php endif; ?>
|
||||
</address>
|
||||
</div><!-- /.col-2 -->
|
||||
|
||||
</section><!-- /.col2-set -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_order_details_after_customer_details', $order ); ?>
|
||||
|
||||
</section>
|
68
templates/order/order-details-item.php
Normal file
68
templates/order/order-details-item.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Item Details
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-details-item.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
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'woocommerce-table__line-item order_item', $item, $order ) ); ?>">
|
||||
|
||||
<td class="woocommerce-table__product-name product-name">
|
||||
<?php
|
||||
$is_visible = $product && $product->is_visible();
|
||||
$product_permalink = apply_filters( 'woocommerce_order_item_permalink', $is_visible ? $product->get_permalink( $item ) : '', $item, $order );
|
||||
|
||||
echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ) );
|
||||
|
||||
$qty = $item->get_quantity();
|
||||
$refunded_qty = $order->get_qty_refunded_for_item( $item_id );
|
||||
|
||||
if ( $refunded_qty ) {
|
||||
$qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>';
|
||||
} else {
|
||||
$qty_display = esc_html( $qty );
|
||||
}
|
||||
|
||||
echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', $qty_display ) . '</strong>', $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, false );
|
||||
|
||||
wc_display_item_meta( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
||||
|
||||
do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, false );
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td class="woocommerce-table__product-total product-total">
|
||||
<?php echo $order->get_formatted_line_subtotal( $item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php if ( $show_purchase_note && $purchase_note ) : ?>
|
||||
|
||||
<tr class="woocommerce-table__product-purchase-note product-purchase-note">
|
||||
|
||||
<td colspan="2"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?php endif; ?>
|
114
templates/order/order-details.php
Normal file
114
templates/order/order-details.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
/**
|
||||
* Order details
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-details.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 4.6.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$order = wc_get_order( $order_id ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
|
||||
|
||||
if ( ! $order ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
|
||||
$show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) );
|
||||
$show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
|
||||
$downloads = $order->get_downloadable_items();
|
||||
$show_downloads = $order->has_downloadable_item() && $order->is_download_permitted();
|
||||
|
||||
if ( $show_downloads ) {
|
||||
wc_get_template(
|
||||
'order/order-downloads.php',
|
||||
array(
|
||||
'downloads' => $downloads,
|
||||
'show_title' => true,
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<section class="woocommerce-order-details">
|
||||
<?php do_action( 'woocommerce_order_details_before_order_table', $order ); ?>
|
||||
|
||||
<h2 class="woocommerce-order-details__title"><?php esc_html_e( 'Order details', 'woocommerce' ); ?></h2>
|
||||
|
||||
<table class="woocommerce-table woocommerce-table--order-details shop_table order_details">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="woocommerce-table__product-name product-name"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th>
|
||||
<th class="woocommerce-table__product-table product-total"><?php esc_html_e( 'Total', 'woocommerce' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
do_action( 'woocommerce_order_details_before_order_table_items', $order );
|
||||
|
||||
foreach ( $order_items as $item_id => $item ) {
|
||||
$product = $item->get_product();
|
||||
|
||||
wc_get_template(
|
||||
'order/order-details-item.php',
|
||||
array(
|
||||
'order' => $order,
|
||||
'item_id' => $item_id,
|
||||
'item' => $item,
|
||||
'show_purchase_note' => $show_purchase_note,
|
||||
'purchase_note' => $product ? $product->get_purchase_note() : '',
|
||||
'product' => $product,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
do_action( 'woocommerce_order_details_after_order_table_items', $order );
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<?php
|
||||
foreach ( $order->get_order_item_totals() as $key => $total ) {
|
||||
?>
|
||||
<tr>
|
||||
<th scope="row"><?php echo esc_html( $total['label'] ); ?></th>
|
||||
<td><?php echo ( 'payment_method' === $key ) ? esc_html( $total['value'] ) : wp_kses_post( $total['value'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<?php if ( $order->get_customer_note() ) : ?>
|
||||
<tr>
|
||||
<th><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th>
|
||||
<td><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
<?php do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
|
||||
</section>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired after the order details.
|
||||
*
|
||||
* @since 4.4.0
|
||||
* @param WC_Order $order Order data.
|
||||
*/
|
||||
do_action( 'woocommerce_after_order_details', $order );
|
||||
|
||||
if ( $show_customer_details ) {
|
||||
wc_get_template( 'order/order-details-customer.php', array( 'order' => $order ) );
|
||||
}
|
73
templates/order/order-downloads.php
Normal file
73
templates/order/order-downloads.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Order Downloads.
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/order-downloads.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.3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<section class="woocommerce-order-downloads">
|
||||
<?php if ( isset( $show_title ) ) : ?>
|
||||
<h2 class="woocommerce-order-downloads__title"><?php esc_html_e( 'Downloads', 'woocommerce' ); ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="woocommerce-table woocommerce-table--order-downloads shop_table shop_table_responsive order_details">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
|
||||
<th class="<?php echo esc_attr( $column_id ); ?>"><span class="nobr"><?php echo esc_html( $column_name ); ?></span></th>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php foreach ( $downloads as $download ) : ?>
|
||||
<tr>
|
||||
<?php foreach ( wc_get_account_downloads_columns() as $column_id => $column_name ) : ?>
|
||||
<td class="<?php echo esc_attr( $column_id ); ?>" data-title="<?php echo esc_attr( $column_name ); ?>">
|
||||
<?php
|
||||
if ( has_action( 'woocommerce_account_downloads_column_' . $column_id ) ) {
|
||||
do_action( 'woocommerce_account_downloads_column_' . $column_id, $download );
|
||||
} else {
|
||||
switch ( $column_id ) {
|
||||
case 'download-product':
|
||||
if ( $download['product_url'] ) {
|
||||
echo '<a href="' . esc_url( $download['product_url'] ) . '">' . esc_html( $download['product_name'] ) . '</a>';
|
||||
} else {
|
||||
echo esc_html( $download['product_name'] );
|
||||
}
|
||||
break;
|
||||
case 'download-file':
|
||||
echo '<a href="' . esc_url( $download['download_url'] ) . '" class="woocommerce-MyAccount-downloads-file button alt">' . esc_html( $download['download_name'] ) . '</a>';
|
||||
break;
|
||||
case 'download-remaining':
|
||||
echo is_numeric( $download['downloads_remaining'] ) ? esc_html( $download['downloads_remaining'] ) : esc_html__( '∞', 'woocommerce' );
|
||||
break;
|
||||
case 'download-expires':
|
||||
if ( ! empty( $download['access_expires'] ) ) {
|
||||
echo '<time datetime="' . esc_attr( date( 'Y-m-d', strtotime( $download['access_expires'] ) ) ) . '" title="' . esc_attr( strtotime( $download['access_expires'] ) ) . '">' . esc_html( date_i18n( get_option( 'date_format' ), strtotime( $download['access_expires'] ) ) ) . '</time>';
|
||||
} else {
|
||||
esc_html_e( 'Never', 'woocommerce' );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</section>
|
60
templates/order/tracking.php
Normal file
60
templates/order/tracking.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Order tracking
|
||||
*
|
||||
* This template can be overridden by copying it to yourtheme/woocommerce/order/tracking.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 2.2.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
$notes = $order->get_customer_order_notes();
|
||||
?>
|
||||
|
||||
<p class="order-info">
|
||||
<?php
|
||||
echo wp_kses_post(
|
||||
apply_filters(
|
||||
'woocommerce_order_tracking_status',
|
||||
sprintf(
|
||||
/* translators: 1: order number 2: order date 3: order status */
|
||||
__( 'Order #%1$s was placed on %2$s and is currently %3$s.', 'woocommerce' ),
|
||||
'<mark class="order-number">' . $order->get_order_number() . '</mark>',
|
||||
'<mark class="order-date">' . wc_format_datetime( $order->get_date_created() ) . '</mark>',
|
||||
'<mark class="order-status">' . wc_get_order_status_name( $order->get_status() ) . '</mark>'
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<?php if ( $notes ) : ?>
|
||||
<h2><?php esc_html_e( 'Order updates', 'woocommerce' ); ?></h2>
|
||||
<ol class="commentlist notes">
|
||||
<?php foreach ( $notes as $note ) : ?>
|
||||
<li class="comment note">
|
||||
<div class="comment_container">
|
||||
<div class="comment-text">
|
||||
<p class="meta"><?php echo date_i18n( esc_html__( 'l jS \o\f F Y, h:ia', 'woocommerce' ), strtotime( $note->comment_date ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p>
|
||||
<div class="description">
|
||||
<?php echo wpautop( wptexturize( $note->comment_content ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_view_order', $order->get_id() ); ?>
|
Reference in New Issue
Block a user