i looking everywhere, but not found this functions, i need to calculate the total items in the report email new order,i think is (admin-new-order.php)
so i need to see the numbers total products
in the under row on subtotal or elsewhere
Item Price Quantity
------------------------------------------------------------------
Product A $10 4
Product B $5 1
Product C $15 2
Cart Totals
Cart Subtotal $30
Count products 7 <---
Shipping Cost $12
Order Total $42
How i do ? Help..me..
i looking everywhere, but not found this functions, i need to calculate the total items in the report email new order,i think is (admin-new-order.php)
so i need to see the numbers total products
in the under row on subtotal or elsewhere
Item Price Quantity
------------------------------------------------------------------
Product A $10 4
Product B $5 1
Product C $15 2
Cart Totals
Cart Subtotal $30
Count products 7 <---
Shipping Cost $12
Order Total $42
How i do ? Help..me..
Share Improve this question edited Feb 5, 2021 at 19:13 Ruvee 1641 gold badge1 silver badge10 bronze badges asked Feb 5, 2021 at 18:12 ExolonExolon 54 bronze badges1 Answer
Reset to default 0You could call either of the following functions in your email template:
<?php echo WC()->cart->get_cart_contents_count(); ?>
OR
<?php echo(count(WC()->cart->get_cart())); ?>