woocommerce_gzd_add_variation_options

Add delivery time and unit price to variations.

Description

woocommerce_gzd_add_variation_options( $options, $product, $variation ); 

Parameters (3)

0. $options
The options.
1. $product
The product.
2. $variation
The variation.

Usage

  1. if ( !function_exists( 'woocommerce_gzd_add_variation_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-template-functions.php'; 
  3.  
  4. // The options. 
  5. $options = null; 
  6.  
  7. // The product. 
  8. $product = null; 
  9.  
  10. // The variation. 
  11. $variation = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = woocommerce_gzd_add_variation_options($options, $product, $variation); 
  15.  

Defined (1)

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

/includes/wc-gzd-template-functions.php  
  1. function woocommerce_gzd_add_variation_options( $options, $product, $variation ) { 
  2.  
  3. $gzd_product = wc_gzd_get_gzd_product( $variation ); 
  4.  
  5. $options[ 'delivery_time' ] = $gzd_product->get_delivery_time_html(); 
  6. $options[ 'unit_price' ] = $gzd_product->get_unit_html(); 
  7. $options[ 'product_units' ] = $gzd_product->get_product_units_html(); 
  8. $options[ 'tax_info' ] = $gzd_product->get_tax_info(); 
  9. $options[ 'shipping_costs_info' ] = $gzd_product->get_shipping_costs_html(); 
  10.  
  11. return $options;