WooCommerce::__construct()
Source
File: classes/WooCommerce.php
public function __construct() { if ( ! dozent_wc_exists() ) { return; } add_filter( 'product_type_options', [ $this, 'dozent_type_in_wc_product' ] ); add_action( 'save_post_product', array( $this, 'save_wc_product_meta' ) ); add_filter( 'woocommerce_product_data_tabs', [ $this, 'add_dozent_courses_product_data_tab' ] ); add_action( 'woocommerce_product_data_panels', [ $this, 'dozent_courses_data_panel' ] ); add_action( 'save_post_product', [ $this, 'attach_courses_to_product' ] ); add_filter( 'dozent_course_price', [ $this, 'filter_course_price' ], 10, 2 ); add_action( 'dozent_course_type_closed_gate', [ $this, 'dozent_course_gate' ] ); /** * Placing order and sync with course enrolment process */ add_action( 'woocommerce_new_order', [ $this, 'placing_order_from_admin' ] ); add_action( 'woocommerce_new_order_item', [ $this, 'placing_order_from_frontend' ], 10, 3 ); add_action( 'woocommerce_order_status_changed', [ $this, 'order_status_changed' ], 10, 3 ); add_filter( 'dozent_course_new_enrol_status', [ $this, 'new_enrol_status' ], 10, 4 ); /** * Add earning data to the database table */ add_action( 'woocommerce_new_order_item', array( $this, 'add_earning_data' ), 10, 3 ); add_action( 'woocommerce_order_status_changed', array( $this, 'earning_data_status_change' ), 10, 3 ); }