wcdn_get_order_totals

The WooCommerce Print Invoices & Delivery Notes wcdn get order totals function.

Description

wcdn_get_order_totals(); 

Usage

  1. if ( !function_exists( 'wcdn_get_order_totals' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-print-invoices-delivery-notes/woocommerce-delivery-notes.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wcdn_get_order_totals(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/woocommerce-delivery-notes.php  
  1. function wcdn_get_order_totals() { 
  2. global $wcdn;  
  3.  
  4. // get totals and remove the semicolon 
  5. $totals = apply_filters( 'wcdn_raw_order_totals', $wcdn->print->get_order()->get_order_item_totals() ); 
  6.  
  7. // remove the colon for every label 
  8. foreach ( $totals as $key => $total ) { 
  9. $label = $total['label']; 
  10. $colon = strrpos( $label, ':' ); 
  11. if( $colon !== false ) { 
  12. $label = substr_replace( $label, '', $colon, 1 ); 
  13. }  
  14. $totals[$key]['label'] = $label; 
  15.  
  16. return apply_filters( 'wcdn_order_totals', $totals );