Viewing 1 replies (of 1 total)
  • Hey Lucas!

    I would do it this way:

    Find the foreach loop, where the items are listed. In woocommerce-delivery-notes/templates/print-order/print-content.php it is located at the line 79:
    <?php foreach( $order->get_items() as $item ) : ?>

    Now I would declare a variable, to count in every iteration the count of items:

    <?php $item_count_per_line = $item['qty'];?>

    This variable will change in every iteration, until the last items count. In every loop iteration, I would add this variable to another variable, at the end of the foreach loop, at line 123, before <?php endforeach; ?>, like this:

    <?php $total_item_amount = $total_item_amount + $item_count_per_line;?>
    <?php endforeach; ?>

    When the foreach loop finishes, you will have the total count of items, in the $total_item_amount variable. You can print it using <?php echo $total_item_amount;?>

Viewing 1 replies (of 1 total)
  • The topic ‘Total item (quantity) count’ is closed to new replies.