| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/coopermain/wp-content/themes/cooper/woocommerce/emails/ |
Upload File : |
<?php
/**
* Email Order Items
*
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.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\Emails
* @version 3.7.0
*/
defined('ABSPATH') || exit;
$text_align = is_rtl() ? 'right' : 'left';
$margin_side = is_rtl() ? 'left' : 'right';
/**
* @var $items WC_Order_Item[]
*/
foreach ($items as $item_id => $item) :
$product = $item->get_product();
$sku = '';
$purchase_note = '';
$image = '';
$is_extra_cost = in_array($product->get_id(),
\LambAgency\WcExtraCostsManager\WcExtraCostsManager::get_fee_prod_ids(), false);
if (!$product || !apply_filters('woocommerce_order_item_visible', true, $item)) {
continue;
}
if($is_fitter && $is_extra_cost && !$show_extras) {
continue;
}
if (is_object($product)) {
$sku = $product->get_sku();
$purchase_note = $product->get_purchase_note();
$image = $product->get_image($image_size);
} ?>
<tr class="<?php echo esc_attr(apply_filters('woocommerce_order_item_class', 'order_item', $item, $order)); ?>">
<?php if (!$is_extra_cost): ?>
<td style="width: 60px; border-top: solid 1px #E6E6E6; padding: 32px 0 0;">
<?php
// Show title/image etc.
if ($show_image) {
echo wp_kses_post(apply_filters('woocommerce_order_item_thumbnail', $image, $item));
}
?>
</td>
<?php endif; ?>
<td colspan="<?= $is_extra_cost ? '3' : '2' ?>"
style="
text-align:<?php echo esc_attr($text_align); ?>;
vertical-align: middle;
font-family: Arial, sans-serif;
word-wrap:break-word; border-top: solid 1px #E6E6E6; padding-top: 48px">
<?php
$name = $product->get_type() === 'variation' ? $product->get_title() : $item->get_name();
$order_item_price = round( ($item->get_subtotal() / $item->get_quantity()) + $order->get_item_tax($item), 2, PHP_ROUND_HALF_UP); //use price inclusive GST
$is_discounted = $product->get_price() > $order_item_price;
// Product name.
echo '<p class="order-item-attr-size" style="margin: 0 0 3px; color: #666666">' . ($product->get_type() === 'variation' ? $product->get_attribute('sizes') : "") . '</p>';
echo '<h2 class="order-item-name" style="margin-bottom: 7px; color: #1B1B1B">' . wp_kses_post(apply_filters('woocommerce_order_item_name', $name, $item, false)) . '</h2>';
?>
<?php if (!$is_fitter):
$suffix = $is_extra_cost ? ' per tyre' : '/ea';
?>
<p class="order-item-unit-price">
<?php if ($is_discounted) { ?>
<del><?= wc_price($product->get_price()) . $product->get_price_suffix() ?></del>
<ins><?= wc_price($order_item_price) . $product->get_price_suffix() ?></ins><?= $suffix ?>
<?php } else {
echo wc_price($order_item_price) . $product->get_price_suffix() . $suffix;
} ?>
</p>
<?php endif; ?>
<?php
// SKU.
if ($show_sku && $sku && !$sent_to_admin && !$is_fitter) {
echo wp_kses_post(' (#' . $sku . ')');
}
?>
<div>
<?php
// allow other plugins to add additional product information here.
do_action('woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text);
wc_display_item_meta($item, array('label_before' => '<strong class="wc-item-meta-label" style="float: ' . esc_attr($text_align) . '; margin-' . esc_attr($margin_side) . ': .25em; clear: both">',));
// allow other plugins to add additional product information here.
do_action('woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text);
?>
</div>
</td>
<td style="border-top: solid 1px #E6E6E6; padding-top: 32px"></td>
<td style="border-top: solid 1px #E6E6E6; padding-top: 32px"></td>
<td style="text-align: right; vertical-align:middle; font-family: Arial, sans-serif; border-top: solid 1px #E6E6E6; padding-top: 32px">
<?php
$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 '<span class="order-item-qty">' . $qty_display . 'X' . '</span>';
?>
</td>
</tr>
<tr>
<td colspan="3"
style="text-align:<?php echo esc_attr($text_align); ?>; vertical-align:middle; font-family: Arial, sans-serif;">
<?php if ($show_purchase_note && $purchase_note) {
echo wp_kses_post(wpautop(do_shortcode($purchase_note)));
} ?>
</td>
<td></td>
<td></td>
<?php if (!$is_fitter): ?>
<td class="order-item-subtotal"
style="text-align:right;
vertical-align:middle;
font-family: Arial, sans-serif; color: #1b1b1b; padding-bottom: 25px;">
<?php echo wp_kses_post($order->get_formatted_line_subtotal($item)); ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>