• Resolved arbremojo

    (@arbremojo)


    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

    (@arbremojo)

    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

    (@wpallimport)

    Hi @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/. 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

    (@wpallimport)

    Hey @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

    (@arbremojo)

    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.