Merged in feature/280-dev-dev01 (pull request #21)

auto-patch  280-dev-dev01-2024-01-19T16_41_58

* auto-patch  280-dev-dev01-2024-01-19T16_41_58
This commit is contained in:
Tony Volpe
2024-01-19 16:44:43 +00:00
parent 2699b5437a
commit be83910651
2125 changed files with 179300 additions and 35639 deletions

View File

@@ -0,0 +1,105 @@
<?php
/**
* Display the Order Attribution Data metabox.
*
* This template is used to display the order source data metabox on the edit order screen.
*
* @see Automattic\WooCommerce\Internal\Orders\OrderAttributionController
* @package WooCommerce\Templates
* @version 8.4.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( 'type', $meta ) ) : ?>
<h4><?php esc_html_e( 'Source type', 'woocommerce' ); ?></h4>
<span class="order-attribution-source_type">
<?php echo esc_html( $meta['type'] ); ?>
</span>
<?php endif; ?>
<?php if ( array_key_exists( 'utm_campaign', $meta ) ) : ?>
<h4><?php esc_html_e( 'UTM 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( 'UTM 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( 'UTM medium', 'woocommerce' ); ?></h4>
<span class="order-attribution-utm-medium">
<?php echo esc_html( $meta['utm_medium'] ); ?>
</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>

View File

@@ -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.4.0
*/
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;
/**
* Variables used in this file.
*
* @var int $order_count The number of paid orders placed by the current customer.
* @var float $total_spent The total money spent by the current customer.
* @var float $average_spent 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( $order_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_spent ) ); ?>
</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( $average_spent ) ); ?>
</span>
</div>

View File

@@ -12,7 +12,9 @@
*
* @see https://woo.com/document/template-structure/
* @package WooCommerce\Templates
* @version 7.8.0
* @version 8.5.0
*
* @var bool $show_downloads Controls whether the downloads table should be rendered.
*/
defined( 'ABSPATH' ) || exit;
@@ -27,7 +29,6 @@ $order_items = $order->get_items( apply_filters( 'woocommerce_purchase
$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(