attribution-details.php
5 months ago
customer-history.php
2 months ago
customer-review-order-empty.php
1 month ago
customer-review-order-row.php
1 month ago
customer-review-order.php
1 month ago
form-tracking.php
2 years ago
order-again.php
2 years ago
order-details-customer.php
2 years ago
order-details-fulfillment-item.php
3 months ago
order-details-fulfillments.php
3 months ago
order-details-item.php
2 years ago
order-details.php
1 month ago
order-downloads.php
2 years ago
star-rating.php
1 month ago
tracking.php
4 months ago
attribution-details.php
170 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Display the Order Attribution details metabox. |
| 4 | * |
| 5 | * This template is used to display the order attribution data metabox on the edit order screen. |
| 6 | * |
| 7 | * @see Automattic\WooCommerce\Internal\Orders\OrderAttributionController |
| 8 | * @package WooCommerce\Templates |
| 9 | * @version 10.3.0 |
| 10 | */ |
| 11 | |
| 12 | declare( strict_types=1 ); |
| 13 | |
| 14 | defined( 'ABSPATH' ) || exit; |
| 15 | |
| 16 | /** |
| 17 | * Variables used in this file. |
| 18 | * |
| 19 | * @var array $meta Array of meta data. |
| 20 | * @var bool $has_more_details Whether to show the more details toggle. |
| 21 | */ |
| 22 | ?> |
| 23 | |
| 24 | <div class="order-attribution-metabox"> |
| 25 | |
| 26 | <?php if ( array_key_exists( 'origin', $meta ) ) : ?> |
| 27 | <h4><?php esc_html_e( 'Origin', 'woocommerce' ); ?></h4> |
| 28 | <?php endif; ?> |
| 29 | |
| 30 | <div class="woocommerce-order-attribution-origin-container"> |
| 31 | |
| 32 | <?php if ( array_key_exists( 'origin', $meta ) ) : ?> |
| 33 | <span class="order-attribution-origin"> |
| 34 | <?php echo esc_html( $meta['origin'] ); ?> |
| 35 | </span> |
| 36 | <?php endif; ?> |
| 37 | |
| 38 | <?php if ( $has_more_details ) : ?> |
| 39 | |
| 40 | <a href="" class="woocommerce-order-attribution-details-toggle" aria-expanded="false"> |
| 41 | <span class="toggle-text show"><?php esc_html_e( 'Show details', 'woocommerce' ); ?></span> |
| 42 | <span class="toggle-text hide" aria-hidden="true"><?php esc_html_e( 'Hide details', 'woocommerce' ); ?></span> |
| 43 | <span class="toggle-indicator" aria-hidden="true"></span> |
| 44 | </a> |
| 45 | <?php endif; ?> |
| 46 | |
| 47 | </div> |
| 48 | |
| 49 | <div class="woocommerce-order-attribution-details-container closed"> |
| 50 | <?php if ( array_key_exists( 'source_type', $meta ) ) : ?> |
| 51 | <h4><?php esc_html_e( 'Source type', 'woocommerce' ); ?></h4> |
| 52 | <span class="order-attribution-source_type"> |
| 53 | <?php echo esc_html( $meta['source_type'] ); ?> |
| 54 | </span> |
| 55 | <?php endif; ?> |
| 56 | |
| 57 | <?php if ( array_key_exists( 'utm_campaign', $meta ) ) : ?> |
| 58 | <h4> |
| 59 | <?php esc_html_e( 'Campaign', 'woocommerce' ); ?> |
| 60 | </h4> |
| 61 | <span class="order-attribution-utm-campaign"> |
| 62 | <?php echo esc_html( $meta['utm_campaign'] ); ?> |
| 63 | </span> |
| 64 | <?php endif; ?> |
| 65 | |
| 66 | <?php if ( array_key_exists( 'utm_source', $meta ) ) : ?> |
| 67 | <h4> |
| 68 | <?php esc_html_e( 'Source', 'woocommerce' ); ?> |
| 69 | </h4> |
| 70 | <span class="order-attribution-utm-source"> |
| 71 | <?php echo esc_html( $meta['utm_source'] ); ?> |
| 72 | </span> |
| 73 | <?php endif; ?> |
| 74 | |
| 75 | <?php if ( array_key_exists( 'utm_medium', $meta ) ) : ?> |
| 76 | <h4> |
| 77 | <?php esc_html_e( 'Medium', 'woocommerce' ); ?> |
| 78 | </h4> |
| 79 | <span class="order-attribution-utm-medium"> |
| 80 | <?php echo esc_html( $meta['utm_medium'] ); ?> |
| 81 | </span> |
| 82 | <?php endif; ?> |
| 83 | |
| 84 | <?php if ( array_key_exists( 'utm_source_platform', $meta ) ) : ?> |
| 85 | <h4> |
| 86 | <?php esc_html_e( 'Source platform', 'woocommerce' ); ?> |
| 87 | </h4> |
| 88 | <span class="order-attribution-utm-source-platform"> |
| 89 | <?php echo esc_html( $meta['utm_source_platform'] ); ?> |
| 90 | </span> |
| 91 | <?php endif; ?> |
| 92 | |
| 93 | <?php if ( array_key_exists( 'utm_creative_format', $meta ) ) : ?> |
| 94 | <h4> |
| 95 | <?php esc_html_e( 'Creative format', 'woocommerce' ); ?> |
| 96 | </h4> |
| 97 | <span class="order-attribution-utm-creative-format"> |
| 98 | <?php echo esc_html( $meta['utm_creative_format'] ); ?> |
| 99 | </span> |
| 100 | <?php endif; ?> |
| 101 | |
| 102 | <?php if ( array_key_exists( 'utm_marketing_tactic', $meta ) ) : ?> |
| 103 | <h4> |
| 104 | <?php esc_html_e( 'Marketing tactic', 'woocommerce' ); ?> |
| 105 | </h4> |
| 106 | <span class="order-attribution-utm-marketing-tactic"> |
| 107 | <?php echo esc_html( $meta['utm_marketing_tactic'] ); ?> |
| 108 | </span> |
| 109 | <?php endif; ?> |
| 110 | |
| 111 | <?php if ( array_key_exists( 'utm_content', $meta ) ) : ?> |
| 112 | <h4> |
| 113 | <?php esc_html_e( 'Content', 'woocommerce' ); ?> |
| 114 | </h4> |
| 115 | <span class="order-attribution-utm-content"> |
| 116 | <?php echo esc_html( $meta['utm_content'] ); ?> |
| 117 | </span> |
| 118 | <?php endif; ?> |
| 119 | |
| 120 | <?php if ( array_key_exists( 'utm_term', $meta ) ) : ?> |
| 121 | <h4> |
| 122 | <?php esc_html_e( 'Term', 'woocommerce' ); ?> |
| 123 | </h4> |
| 124 | <span class="order-attribution-utm-term"> |
| 125 | <?php echo esc_html( $meta['utm_term'] ); ?> |
| 126 | </span> |
| 127 | <?php endif; ?> |
| 128 | |
| 129 | <?php if ( array_key_exists( 'utm_id', $meta ) ) : ?> |
| 130 | <h4> |
| 131 | <?php esc_html_e( 'ID', 'woocommerce' ); ?> |
| 132 | </h4> |
| 133 | <span class="order-attribution-utm-id"> |
| 134 | <?php echo esc_html( $meta['utm_id'] ); ?> |
| 135 | </span> |
| 136 | <?php endif; ?> |
| 137 | |
| 138 | </div> |
| 139 | |
| 140 | <?php if ( array_key_exists( 'device_type', $meta ) ) : ?> |
| 141 | <h4><?php esc_html_e( 'Device type', 'woocommerce' ); ?></h4> |
| 142 | <span class="order-attribution-device_type"> |
| 143 | <?php echo esc_html( $meta['device_type'] ); ?> |
| 144 | </span> |
| 145 | <?php endif; ?> |
| 146 | |
| 147 | <?php if ( array_key_exists( 'session_pages', $meta ) ) : ?> |
| 148 | <h4> |
| 149 | <?php |
| 150 | esc_html_e( 'Session page views', 'woocommerce' ); |
| 151 | echo wp_kses_post( |
| 152 | wc_help_tip( |
| 153 | __( |
| 154 | 'The number of unique pages viewed by the customer prior to this order.', |
| 155 | 'woocommerce' |
| 156 | ) |
| 157 | ) |
| 158 | ); |
| 159 | ?> |
| 160 | </h4> |
| 161 | <span class="order-attribution-utm-session-pages"> |
| 162 | <?php echo esc_html( $meta['session_pages'] ); ?> |
| 163 | </span> |
| 164 | <?php endif; ?> |
| 165 | <!-- A placeholder for the OA install banner React component. --> |
| 166 | <?php if ( class_exists( 'WC_Marketplace_Suggestions' ) && \WC_Marketplace_Suggestions::allow_suggestions() ) : ?> |
| 167 | <div id="order-attribution-install-banner-slotfill"></div> |
| 168 | <?php endif; ?> |
| 169 | </div> |
| 170 |