plugin install
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* Display the Order Attribution details metabox.
|
||||
*
|
||||
* This template is used to display the order attribution data metabox on the edit order screen.
|
||||
*
|
||||
* @see Automattic\WooCommerce\Internal\Orders\OrderAttributionController
|
||||
* @package WooCommerce\Templates
|
||||
* @version 9.0.0
|
||||
*/
|
||||
|
||||
declare( strict_types=1 );
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Variables used in this file.
|
||||
*
|
||||
* @var array $meta Array of meta data.
|
||||
* @var bool $has_more_details Whether to show the more details toggle.
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="order-attribution-metabox">
|
||||
|
||||
<?php if ( array_key_exists( 'origin', $meta ) ) : ?>
|
||||
<h4><?php esc_html_e( 'Origin', 'woocommerce' ); ?></h4>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="woocommerce-order-attribution-origin-container">
|
||||
|
||||
<?php if ( array_key_exists( 'origin', $meta ) ) : ?>
|
||||
<span class="order-attribution-origin">
|
||||
<?php echo esc_html( $meta['origin'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( $has_more_details ) : ?>
|
||||
|
||||
<a href="" class="woocommerce-order-attribution-details-toggle" aria-expanded="false">
|
||||
<span class="toggle-text show"><?php esc_html_e( 'Show details', 'woocommerce' ); ?></span>
|
||||
<span class="toggle-text hide" aria-hidden="true"><?php esc_html_e( 'Hide details', 'woocommerce' ); ?></span>
|
||||
<span class="toggle-indicator" aria-hidden="true"></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="woocommerce-order-attribution-details-container closed">
|
||||
<?php if ( array_key_exists( 'source_type', $meta ) ) : ?>
|
||||
<h4><?php esc_html_e( 'Source type', 'woocommerce' ); ?></h4>
|
||||
<span class="order-attribution-source_type">
|
||||
<?php echo esc_html( $meta['source_type'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'utm_campaign', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php esc_html_e( 'Campaign', 'woocommerce' ); ?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-campaign">
|
||||
<?php echo esc_html( $meta['utm_campaign'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'utm_source', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php esc_html_e( 'Source', 'woocommerce' ); ?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-source">
|
||||
<?php echo esc_html( $meta['utm_source'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'utm_medium', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php esc_html_e( 'Medium', 'woocommerce' ); ?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-medium">
|
||||
<?php echo esc_html( $meta['utm_medium'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'utm_source_platform', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php esc_html_e( 'Source platform', 'woocommerce' ); ?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-source-platform">
|
||||
<?php echo esc_html( $meta['utm_source_platform'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'utm_creative_format', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php esc_html_e( 'Creative format', 'woocommerce' ); ?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-creative-format">
|
||||
<?php echo esc_html( $meta['utm_creative_format'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'utm_marketing_tactic', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php esc_html_e( 'Marketing tactic', 'woocommerce' ); ?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-marketing-tactic">
|
||||
<?php echo esc_html( $meta['utm_marketing_tactic'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ( array_key_exists( 'device_type', $meta ) ) : ?>
|
||||
<h4><?php esc_html_e( 'Device type', 'woocommerce' ); ?></h4>
|
||||
<span class="order-attribution-device_type">
|
||||
<?php echo esc_html( $meta['device_type'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( array_key_exists( 'session_pages', $meta ) ) : ?>
|
||||
<h4>
|
||||
<?php
|
||||
esc_html_e( 'Session page views', 'woocommerce' );
|
||||
echo wp_kses_post(
|
||||
wc_help_tip(
|
||||
__(
|
||||
'The number of unique pages viewed by the customer prior to this order.',
|
||||
'woocommerce'
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
</h4>
|
||||
<span class="order-attribution-utm-session-pages">
|
||||
<?php echo esc_html( $meta['session_pages'] ); ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* Display the Customer History metabox.
|
||||
*
|
||||
* This template is used to display the customer history metabox on the edit order screen.
|
||||
*
|
||||
* @see Automattic\WooCommerce\Internal\Admin\Orders\MetaBoxes\CustomerHistory
|
||||
* @package WooCommerce\Templates
|
||||
* @version 8.7.0
|
||||
*/
|
||||
|
||||
declare( strict_types=1 );
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Variables used in this file.
|
||||
*
|
||||
* @var int $orders_count The number of paid orders placed by the current customer.
|
||||
* @var float $total_spend The total money spent by the current customer.
|
||||
* @var float $avg_order_value The average money spent by the current customer.
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="customer-history order-attribution-metabox">
|
||||
<h4>
|
||||
<?php
|
||||
esc_html_e( 'Total orders', 'woocommerce' );
|
||||
echo wp_kses_post(
|
||||
wc_help_tip(
|
||||
__( 'Total number of non-cancelled, non-failed orders for this customer, including the current one.', 'woocommerce' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</h4>
|
||||
|
||||
<span class="order-attribution-total-orders">
|
||||
<?php echo esc_html( $orders_count ); ?>
|
||||
</span>
|
||||
|
||||
<h4>
|
||||
<?php
|
||||
esc_html_e( 'Total revenue', 'woocommerce' );
|
||||
echo wp_kses_post(
|
||||
wc_help_tip(
|
||||
__( "This is the Customer Lifetime Value, or the total amount you have earned from this customer's orders.", 'woocommerce' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</h4>
|
||||
<span class="order-attribution-total-spend">
|
||||
<?php echo wp_kses_post( wc_price( $total_spend ) ); ?>
|
||||
</span>
|
||||
|
||||
<h4><?php esc_html_e( 'Average order value', 'woocommerce' ); ?></h4>
|
||||
<span class="order-attribution-average-order-value">
|
||||
<?php echo wp_kses_post( wc_price( $avg_order_value ) ); ?>
|
||||
</span>
|
||||
</div>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?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://woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 7.0.1
|
||||
*/
|
||||
|
||||
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">
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired at the beginning of the form-tracking form.
|
||||
*
|
||||
* @since 6.5.0
|
||||
*/
|
||||
do_action( 'woocommerce_order_tracking_form_start' );
|
||||
?>
|
||||
|
||||
<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>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired in the middle of the form-tracking form (before the submit button).
|
||||
*
|
||||
* @since 6.5.0
|
||||
*/
|
||||
do_action( 'woocommerce_order_tracking_form' );
|
||||
?>
|
||||
|
||||
<p class="form-row"><button type="submit" class="button<?php echo esc_attr( wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( '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' ); ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired at the end of the form-tracking form (after the submit button).
|
||||
*
|
||||
* @since 6.5.0
|
||||
*/
|
||||
do_action( 'woocommerce_order_tracking_form_end' );
|
||||
?>
|
||||
|
||||
</form>
|
||||
@@ -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://woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 7.8.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
?>
|
||||
|
||||
<p class="order-again">
|
||||
<a href="<?php echo esc_url( $order_again_url ); ?>" class="button<?php echo esc_attr( $wp_button_class ); ?>"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a>
|
||||
</p>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?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://woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 8.7.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; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired after an address in the order customer details.
|
||||
*
|
||||
* @since 8.7.0
|
||||
* @param string $address_type Type of address (billing or shipping).
|
||||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
do_action( 'woocommerce_order_details_after_customer_address', 'billing', $order );
|
||||
?>
|
||||
</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; ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Action hook fired after an address in the order customer details.
|
||||
*
|
||||
* @since 8.7.0
|
||||
* @param string $address_type Type of address (billing or shipping).
|
||||
* @param WC_Order $order Order object.
|
||||
*/
|
||||
do_action( 'woocommerce_order_details_after_customer_address', 'shipping', $order );
|
||||
?>
|
||||
</address>
|
||||
</div><!-- /.col-2 -->
|
||||
|
||||
</section><!-- /.col2-set -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_order_details_after_customer_details', $order ); ?>
|
||||
|
||||
</section>
|
||||
@@ -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://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; ?>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?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://woocommerce.com/document/template-structure/
|
||||
* @package WooCommerce\Templates
|
||||
* @version 9.0.0
|
||||
*
|
||||
* @var bool $show_downloads Controls whether the downloads table should be rendered.
|
||||
*/
|
||||
|
||||
// phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment
|
||||
|
||||
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' ) ) );
|
||||
$downloads = $order->get_downloadable_items();
|
||||
|
||||
// We make sure the order belongs to the user. This will also be true if the user is a guest, and the order belongs to a guest (userID === 0).
|
||||
$show_customer_details = $order->get_user_id() === get_current_user_id();
|
||||
|
||||
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 wp_kses_post( $total['value'] ); ?></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 ) );
|
||||
}
|
||||
@@ -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://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>
|
||||
@@ -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://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