By default, WooCommerce only shows the product’s unit price (or price per item) only on the cart page. On the Checkout, Thank You page, Emails, and order view in My Account, the user is not shown the price per unit and instead they are shown the subtotal. For the most aesthetically pleasing solution, editing the template files would be the best option but this has it’s drawbacks when it comes to updates and security. This solution shows you how you can display each product’s unit price on the Checkout, Thank You page, Emails, and order view in My Account. This solution is particularly useful when customers are checking out with more than one quantity of an item and need to be reminded the individual price of a product (it’s single unit price) rather than the subtotal which is the unit price multiplied by the quantity.
/**
* Snippet Name: WooCommerce show the price per unit on the Checkout, Thank You page, Emails, and order view in My Account.
* Snippet Author: ecommercehints.com
*/
// Show product unit price on the Thank You Page, Emails, and order view in My Account.
function ecommercehints_return_unit_price( $product ) {
$unit_price = wc_price($product->get_price());
if (!empty($unit_price )) {
return '
(Unit Price: ' . $unit_price . ')';
} else {
return '';
}
}
add_action( 'woocommerce_order_item_meta_start', 'ecommercehints_show_unit_price_below_product_name', 10, 4 );
function ecommercehints_show_unit_price_below_product_name( $item_id, $item, $order, $plain_text ) {
$product = $item->get_product();
echo ecommercehints_return_unit_price( $product );
}
// Show Product Unit Price On The Checkout
add_filter( 'woocommerce_cart_item_subtotal', 'ecommercehints_show_unit_price_below_subtotal', 10, 3 );
function ecommercehints_show_unit_price_below_subtotal( $wc, $cart_item, $cart_item_key ) {
if ( ! is_cart() ) { // The cart already shows unit price so no need to show it again here
$unit_price = wc_price(get_post_meta($cart_item['product_id'] , '_price', true));
return $wc . '
(Unit Price: ' . $unit_price . ')';
} else {
return $wc;
}
}
Product Unit Price Showing On Thank You Page

Product Unit Price Showing On Emails

Product Unit Price Showing On Order View In My Account
