WC_Naguro_Order_Admin

The WooCommerce Naguro Connect WC Naguro Order Admin class.

Defined (1)

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

/includes/woocommerce/admin/class-wc-naguro-order-admin.php  
  1. class WC_Naguro_Order_Admin { 
  2. public function __construct() { 
  3. add_action( 'woocommerce_after_order_itemmeta', array( $this, 'output_line_item' ), 10, 3 ); 
  4.  
  5. public function output_line_item( $item_id, $item, $product ) { 
  6. if ( isset( $item['naguro_session_object'] ) ) { 
  7. $session_object = unserialize( $item['naguro_session_object'] ); 
  8. if ( isset( $session_object['preview'] ) && is_array( $session_object['preview'] ) ) { 
  9. $design_areas = get_post_meta( $product->id, 'naguro_design_area' ); 
  10.  
  11. $output_array[] = '<b>Download designs:</b> '; 
  12.  
  13. foreach ( $session_object['preview'] as $key => $objects ) { 
  14. // Check if 'full_size_src' is set, or else return just 'src' for backwards compatibility 
  15. $download_link = ( isset( $objects['full_size_src'] ) ) ? $objects['full_size_src'] : $objects['src']; 
  16. $output_array[] = '<a href="' . $download_link . '">' . $design_areas[ $key ]['name'] . '</a>'; 
  17.  
  18. echo array_shift( $output_array ); 
  19. echo implode( ', ', $output_array );