WC_Naguro

The WooCommerce Naguro Connect WC Naguro class.

Defined (1)

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

/includes/woocommerce/core/class-wc-naguro.php  
  1. class WC_Naguro { 
  2. /** @var WC_Naguro_Ajax */ 
  3. private $ajax_handler; 
  4.  
  5. /** @var string */ 
  6. static $prefix = "naguro_"; 
  7.  
  8. /** @var WC_Naguro_Product_Meta_Box */ 
  9. private $product_data_meta_box; 
  10.  
  11. public function __construct() { 
  12. if ( is_admin() && ( ! defined( 'DOING_AJAX' ) || false == DOING_AJAX ) ) { 
  13. $this->admin_init(); 
  14. } else { 
  15. add_action( 'init', array( $this, 'conditional_include' ) ); 
  16. $this->frontend_init(); 
  17.  
  18. // Setup the Ajax dispatcher 
  19. $this->ajax_handler = new WC_Naguro_Ajax(); 
  20.  
  21. add_action( 'naguro_api_handler_class', array( $this, 'api_handler_class' ), 10, 0 ); 
  22.  
  23. new WC_Naguro_Downloader(); 
  24. new Naguro_Modules_Loader(); 
  25. new Naguro_WordPress_Menu(); 
  26. new Naguro_WordPress_Settings_Init(); 
  27. new Naguro_WordPress_Action_Listener(); 
  28.  
  29. public function api_handler_class() { 
  30. return 'WordPress_API_Handler'; 
  31.  
  32. /** 
  33. * Prepare the administration panel specific files and classes 
  34. */ 
  35. private function admin_init() { 
  36. new WC_Naguro_Order_Admin(); 
  37. new WC_Naguro_Editor_Manager(); 
  38.  
  39. $this->product_data_meta_box = new WC_Naguro_Product_Meta_Box(); 
  40. add_action( 'save_post', array( $this->product_data_meta_box, 'save' ), 10, 1 ); 
  41.  
  42. // Meta boxes loaded at priority 31 so the WooCommerce "Product Data" meta box is right above it 
  43. add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ), 31 ); 
  44.  
  45. public function add_meta_boxes() { 
  46. add_meta_box( 'woocommerce-naguro-product-data', __( 'Naguro', 'woocommerce_naguro_connect' ), array( $this->product_data_meta_box, 'output' ), 'product', 'normal', 'high' ); 
  47.  
  48. /** 
  49. * Prepare frontend specific classes 
  50. */ 
  51. private function frontend_init() { 
  52. new WC_Naguro_Cart(); 
  53.  
  54. /** 
  55. * Prepare the specific files and classes who will be loaded based on WooCommerce conditionals 
  56. */ 
  57. public function conditional_include() { 
  58. if ( is_checkout() || is_checkout_pay_page() ) { 
  59. new WC_Naguro_Checkout();