woo_show_compare_fields

Show compare fields panel.

Description

woo_show_compare_fields( (string) $product_id = '', (constant) $echo = false ); 

Parameters (2)

0. $product_id — Optional. (string) => ''
The product id.
1. $echo — Optional. (constant) => false
The echo.

Usage

  1. if ( !function_exists( 'woo_show_compare_fields' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-compare-products-lite/compare_products.php'; 
  3.  
  4. // The product id. 
  5. $product_id = ''; 
  6.  
  7. // The echo. 
  8. $echo = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = woo_show_compare_fields($product_id, $echo); 
  12.  

Defined (1)

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

/compare_products.php  
  1. function woo_show_compare_fields($product_id = '', $echo = false) 
  2. $html = WC_Compare_Hook_Filter::show_compare_fields($product_id); 
  3. if ($echo) echo $html; 
  4. else return $html;