WC_Gateway_COD::__construct │ public │ WC 1.0

Constructor for the gateway.

Метод класса: WC_Gateway_COD{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WC_Gateway_COD = new WC_Gateway_COD();
$WC_Gateway_COD->__construct();

Код WC_Gateway_COD::__construct() WC 11.3.0

public function __construct() {
	// Setup general properties.
	$this->setup_properties();

	// Load the settings.
	$this->init_form_fields();
	$this->init_settings();

	// Get settings.
	$this->title        = $this->get_option( 'title' );
	$this->description  = $this->get_option( 'description' );
	$this->instructions = $this->get_option( 'instructions' );
	$this->init_shipping_method_restrictions();

	// Actions.
	add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) );
	add_action( 'woocommerce_thankyou_' . $this->id, array( $this, 'thankyou_page' ) );
	add_filter( 'woocommerce_payment_complete_order_status', array( $this, 'change_payment_complete_order_status' ), 10, 3 );

	// Customer Emails.
	add_action( 'woocommerce_email_before_order_table', array( $this, 'email_instructions' ), 10, 3 );
}