Exemplo n.º 1
0
 /**
  * Sets required hooks.
  */
 public function set_hooks()
 {
     parent::set_hooks();
 }
Exemplo n.º 2
0
 /**
  * Sets the hooks required by the plugin.
  */
 protected function set_hooks()
 {
     parent::set_hooks();
     if (!is_admin() || self::doing_ajax()) {
         // Add hooks to alter the tax display flag depending on user's country
         add_filter('option_woocommerce_tax_display_shop', array($this, 'option_woocommerce_tax_display_shop'));
         add_filter('option_woocommerce_tax_display_cart', array($this, 'option_woocommerce_tax_display_cart'));
         add_filter('woocommerce_get_price_suffix', array($this, 'woocommerce_get_price_suffix'), 10, 2);
         add_filter('woocommerce_countries_ex_tax_or_vat', array($this, 'woocommerce_countries_ex_tax_or_vat'), 10, 1);
         add_filter('woocommerce_countries_inc_tax_or_vat', array($this, 'woocommerce_countries_inc_tax_or_vat'), 10, 1);
     }
     // Register Widgets
     add_action('widgets_init', array($this, 'register_widgets'));
     // Set the default checkout country to the one selected by the user
     add_filter('default_checkout_country', array($this, 'default_checkout_country'));
     add_filter('get_user_metadata', array($this, 'get_user_metadata'), 10, 4);
     // Add hooks for shortcodes
     $this->set_shortcodes_hooks();
 }