Title: Get total quantity
Last modified: November 19, 2020

---

# Get total quantity

 *  Resolved [arbremojo](https://wordpress.org/support/users/arbremojo/)
 * (@arbremojo)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/get-total-quantity/)
 * Hi,
 * I would like to get total quantity instead of quantity per product. Of can I 
   do that ?
 * Best regards,
 * Clara.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [arbremojo](https://wordpress.org/support/users/arbremojo/)
 * (@arbremojo)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/get-total-quantity/#post-13683101)
 * To clarify my request, when I add the quantity element, it creates one column
   Quantity for each product of the order in my CSV, but I would like only one column
   Quantity with the total Quantity of bought products.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/get-total-quantity/#post-13688793)
 * Hi [@arbremojo](https://wordpress.org/support/users/arbremojo/),
 * > I would like only one column Quantity with the total Quantity of bought products.
 * You can do that with a custom PHP function (used on the Order ID element): [https://www.wpallimport.com/documentation/export/pass-data-through-php-functions/](https://www.wpallimport.com/documentation/export/pass-data-through-php-functions/).
   Here’s an example function that you can modify as needed:
 *     ```
       function my_get_total_order_qty( $order_id ) {
       	if ( $order = wc_get_order( $order_id ) ) {
       		return $order->get_item_count();
       	}
       }
       ```
   
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/get-total-quantity/#post-13727542)
 * Hey [@arbremojo](https://wordpress.org/support/users/arbremojo/),
 * I’m marking this as resolved since we haven’t heard back in a while. Feel free
   to reply here if you still have questions.
 * Anyone else, please open a new topic.
 *  Thread Starter [arbremojo](https://wordpress.org/support/users/arbremojo/)
 * (@arbremojo)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/get-total-quantity/#post-13730888)
 * I’m sorry I forgot to reply, it helped me a lot! Actually, I didn’t know we could
   access $order through these functions.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Get total quantity’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-export/assets/icon-256x256.png?rev=2570162)
 * [WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel](https://wordpress.org/plugins/wp-all-export/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-export/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-export/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-export/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-export/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-export/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [arbremojo](https://wordpress.org/support/users/arbremojo/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/get-total-quantity/#post-13730888)
 * Status: resolved