yith_compare_button

The YITH WooCommerce Compare yith compare button shortcode.


Usage

  1. // basic usage 
  2. echo do_shortcode('[yith_compare_button]'); 
  1. // variable usage 
  2. $result = do_shortcode('[yith_compare_button]'); 
  3. echo $result;  

Defined (1)

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

/includes/class.yith-woocompare-frontend.php  
  1. add_action( 'init', array( $this, 'remove_product_from_compare_action' ), 15 ); 
  2. add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 
  3. add_action( 'template_redirect', array( $this, 'compare_table_html' ) ); 
  4.  
  5. // add the shortcode 
  6. add_shortcode( 'yith_compare_button', array( $this, 'compare_button_sc' ) ); 
  7.  
  8. // AJAX 
  9. if( version_compare( WC()->version, '2.4', '>=' ) ) { 
  10. add_action( 'wc_ajax_' . $this->action_add, array( $this, 'add_product_to_compare_ajax' ) ); 
  11. add_action( 'wc_ajax_' . $this->action_remove, array( $this, 'remove_product_from_compare_ajax' ) );