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.
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();
}
}
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.
I’m sorry I forgot to reply, it helped me a lot! Actually, I didn’t know we could access $order through these functions.