Blog Standard

Show Woocommerce Total Sales anywhere in page using shortcode

// Add this code to your theme's functions.php file or a custom plugin function net_sales_shortcode() { // Make sure WooCommerce is active if (class_exists('WooCommerce')) { // Get completed and processing orders $order_statuses = array('completed', 'processing'); $completed_orders = wc_get_orders(array( 'status' => $order_statuses, 'limit' => -1, // Get all orders )); // Initialize net sales amount $net_sales…
Read More