wcdn_additional_product_fields

Additional fields for the product.

Description

wcdn_additional_product_fields( $fields, $product, $order ); 

Parameters (3)

0. $fields
The fields.
1. $product
The product.
2. $order
The order.

Usage

  1. if ( !function_exists( 'wcdn_additional_product_fields' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-print-invoice-delivery-note/includes/wcdn-template-functions.php'; 
  3.  
  4. // The fields. 
  5. $fields = null; 
  6.  
  7. // The product. 
  8. $product = null; 
  9.  
  10. // The order. 
  11. $order = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = wcdn_additional_product_fields($fields, $product, $order); 
  15.  

Defined (1)

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

/includes/wcdn-template-functions.php  
  1. function wcdn_additional_product_fields( $fields = null, $product = null, $order ) { 
  2. $new_fields = array(); 
  3.  
  4. // Stock keeping unit 
  5. if( $product && $product->exists() && $product->get_sku() ) { 
  6. $fields[] = array( 
  7. 'label' => __( 'SKU:', 'woocommerce-delivery-notes' ),  
  8. 'value' => $product->get_sku() 
  9. ); 
  10. }  
  11. return array_merge( $fields, $new_fields );