Please try with this, I hope it will be help, I did try with this code. It’s work for me.
add_filter( 'manage_edit-shop_order_columns', 'admin_orders_list_add_column', 10, 1 );
function admin_orders_list_add_column( $columns ){
$columns['custom_column2'] = __( 'Quantidade', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column' , 'admin_orders_list_column_content', 10, 2 );
function admin_orders_list_column_content( $column){
global $the_order; // the global order object
if ( 'custom_column2' === $column ) {
// get items from the order global object
$order_items = $the_order->get_items();
if ( !is_wp_error( $order_items ) ) {
foreach( $order_items as $order_item) {
$order_count[$order_item["product_id"]] = $order_item["quantity"];
$total_order = array_sum($order_count);
}
echo '<p>Qty: ' . $total_order . '</p>';
}
}
}
Related Posts:
- How to check if is in cart page? [closed]
- Display single product attribute value on Shop page (Woocommerce)
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]
- Woocommerce 3.1 Add product image to order confirmation email not working
- Woocommerce: show default variation price is products list?
- Button to update order status Woocommerce with WC Marketplace
- WooCommerce add_to_cart url not working [closed]
- WooCommerce: display text instead of raw checkbox value email
- How to Add Product Variation with Multiple Images via WooCommerce REST API
- How to build wordpress site which will have location based services & products?
- How we can edit variations on cart page? [closed]
- new WC_Order(); Coming Back Empty
- Is there any way to find which action/hook is fired?
- WooCommerce: Adding Order Item Meta Data That’s Hidden
- Redirect user after login through woocommerce login page to page with his/her username?
- WooCommerce restore stock on order cancel
- Woocoomerce product category count including subcategories
- WooCommerce single products images doesn’t zoom on hover and doesn’t change clicking on gallery
- Get the category ID in checkout page woocomerce
- “Cannot read property ‘replace’ of undefined” Javascript error when trying to add attribute terms from add product page [closed]
- Order list woocommerce Orders based on meta for custom status
- WooCommerce product taxonomies and menu export
- Javascript / Ajax Error After Migrating To New Domain Name
- How can i stop woocommerce checkout event based on api request result?
- WordPress Twenty Seventeen header image size not responsive for mobile
- WooCommerce back-end very slow takes 10 seconds to load, slow queries
- Woocommerce custom meta fields, sort by date
- WooCommerce hide unexisting variations
- How can I change the functionality of breadcrumbs?
- jquery.validation.js is not working in woocommerce checkout page form
- How do I group product variations on cart page (Woocommerce)?
- multi-vender wooCommerce ability to separate products based on zip code [closed]
- Hide account tab to certain users
- How to Update the Order-Items While Editing an Order on the WooCommerce Admin Order Screen [closed]
- I want to run a script only once on a ‘thank you’ page
- search customers in front end by billing data
- WOOCOOMERCE: Run function before payment gateway (paying)
- Can’t filter out variable products in sale from wp_get_products loop (or shortcode) [closed]
- Send email notifications to a defined email address depending if a product in order has a specific TAG [closed]
- main menu hide woo commerce single products tittle
- What Hook/Action is performed when a field in checkout form is changed in WooCommerce
- Benefits over using object method over property from $product?
- Order by date on category dynamically – Woocommerce
- Woocomnerce Limit Purchase value before proceed checkout
- Add to cart – button should be disabled
- WooCommerce – change child category URL structure
- How To Customize The Product Page Template for a WooCommerce Custom Product Type Plugin [closed]
- Hide Add to Cart button on woocommerce Product description page of a particular product
- What is better way to sync wp multisite woocommerce products
- Remove required from a custom field created from WooCommerce Checkout Field Editor plugin
- How to change status of woocommerce orders when post status is changed
- manage_shop_order_posts_custom_column() hook is Not working In Functions.php file in my WordPress active theme
- How to send woocommerce emails in multiple languages
- Custom WooCommerce rewrite rules with comma delimiter
- Set city as required if country is Singapore
- Woocommerce custom taxonomy filtering
- WooCommerce Simple Auctions add username to auction finished email
- Enable Gutenberg for Woocommerce
- How to change product category permalinks programmatically?
- Make e-Mail optional on Woocommerce sign up
- Missing variable options on add to cart form
- Create order actions from custom fields woocommerce
- Woocommerce digital download not working – database error Cannot add or update a child row: a foreign key constraint fails [closed]
- when product out of stock single page show button notify woo-commerce
- WooCommerce , Auto cancel orders status from processing after X days
- Change WooCommerce Word “Product” to Another Word
- How does a WooCommerce site integrate with the existing real world customer members?
- How can I send information when a order is completed to my own POS?
- How can i add product Accessories from front-end using custom php form?
- How to save order item custom attributes save into custom table
- Manually create an order with a product ID woocommerce
- How to filter result set in custom metaboxes?
- How to change lost password email text using custom plugin wordpress?
- wc_mail in foreach loop is sending only the first email
- How to fix: “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.” after malware cleaning
- How to hide / remove duplicated Woocommerce products from Shop page
- How to add product variations for large number of products in WooCommerce?
- Change order status after checkout
- Is it safe to update an old site after backing it up and activating a child theme?
- Disable Woocommerce main shop page, but not the product category archive pages
- Woocommerce Languages Files
- How to adjust Related Page Thumb Sizes on single page?
- How to store ACF from product in user_meta?
- Changing second user role while updating/downgrading membership level – s2member [closed]
- How to edit the header banner in the search page in woocommerce?
- How can I display one product using WooCommerce
- How do I change the woocommerce product gallery to show all thumbnails instead of three at a time in a carousel?
- Trying to link to a custom css file in a new folder
- How to edit schema.org markup of WooCommerce?
- Turkish Character Problem on mailing
- WooCommerce: Order Details Table > Add Product Meta
- How to change redirect code? [duplicate]
- How to disable schema from Wocommerce? [closed]
- Send data to external websites when there is an update or create a post
- Add a custom code with custom link after add to cart for every product
- WooCommerce product permalink based on product’s current category
- Disable duplicate WC product category URLs
- how should i get products based on tags in woocommerce
- Add custom text to product category page
- Woocommerce permalink URL change in DB