Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! You can do this with a small code snippet in a custom template:

    
    <?php echo count( $this->order->get_items() ); ?>
    

    Hope that helps!

    Ewout

    Thread Starter cschlichting

    (@cschlichting)

    Hi Ewout,
    With this code he added the number of items in the order, not the total quantity.
    Sorry if I did not explain it right.

    Plugin Contributor Ewout

    (@pomegranate)

    I see – Still possible but a bit more code:

    
    <?php
    $items = $this->order->get_items();
    $total_qty = 0;
    if( sizeof( $items ) > 0 ) {
    	foreach( $items as $item ) {
    		$total_qty += $item['qty'];
    	}
    }
    echo $total_qty;
    ?>
    
    Thread Starter cschlichting

    (@cschlichting)

    ?? Thanks a lot!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Total Products’ is closed to new replies.