WC_Shipping_Local_Pickup::init_form_fields()publicWC 1.0

Init form fields.

Method of the class: WC_Shipping_Local_Pickup{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Shipping_Local_Pickup = new WC_Shipping_Local_Pickup();
$WC_Shipping_Local_Pickup->init_form_fields();

WC_Shipping_Local_Pickup::init_form_fields() code WC 9.4.2

public function init_form_fields() {
	$this->instance_form_fields = array(
		'title'      => array(
			'title'       => __( 'Name', 'woocommerce' ),
			'type'        => 'text',
			'description' => __( 'Your customers will see the name of this shipping method during checkout.', 'woocommerce' ),
			'default'     => __( 'Local pickup', 'woocommerce' ),
			'placeholder' => __( 'e.g. Local pickup', 'woocommerce' ),
			'desc_tip'    => true,
		),
		'tax_status' => array(
			'title'   => __( 'Tax status', 'woocommerce' ),
			'type'    => 'select',
			'class'   => 'wc-enhanced-select',
			'default' => 'taxable',
			'options' => array(
				'taxable' => __( 'Taxable', 'woocommerce' ),
				'none'    => _x( 'None', 'Tax status', 'woocommerce' ),
			),
		),
		'cost'       => array(
			'title'             => __( 'Cost', 'woocommerce' ),
			'type'              => 'text',
			'class'             => 'wc-shipping-modal-price',
			'placeholder'       => wc_format_localized_price( 0 ),
			'description'       => __( 'Optional cost for local pickup.', 'woocommerce' ),
			'default'           => '',
			'desc_tip'          => true,
			'sanitize_callback' => array( $this, 'sanitize_cost' ),
		),
	);
}