Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wp php get total product order quantity

$total_quantity = 0; // Initializing

// Loop through order items
foreach ( $order->get_items() as $item_id => $item ) {
    $total_quantity += $item->get_quantity();
}
// Output
echo '<p>Total items quantity: '.$total_quantity.'</p>';
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wp #php #total #product #order #quantity
ADD COMMENT
Topic
Name
7+9 =