WC_Admin_Setup_Wizard::get_product_weight_selection()protectedWC 1.0

Deprecated from version 4.6.0. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

Render a product weight unit dropdown.

{} It's a method of the class: WC_Admin_Setup_Wizard{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_product_weight_selection();

Changelog

Deprecated 4.6.0

Code of WC_Admin_Setup_Wizard::get_product_weight_selection() WC 6.7.0

<?php
protected function get_product_weight_selection() {
	_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
	$weight_unit = get_option( 'woocommerce_weight_unit' );
	ob_start();
	?>
	<span class="wc-setup-shipping-unit">
		<select id="weight_unit" name="weight_unit" class="wc-enhanced-select">
			<option value="kg" <?php selected( $weight_unit, 'kg' ); ?>><?php esc_html_e( 'Kilograms', 'woocommerce' ); ?></option>
			<option value="g" <?php selected( $weight_unit, 'g' ); ?>><?php esc_html_e( 'Grams', 'woocommerce' ); ?></option>
			<option value="lbs" <?php selected( $weight_unit, 'lbs' ); ?>><?php esc_html_e( 'Pounds', 'woocommerce' ); ?></option>
			<option value="oz" <?php selected( $weight_unit, 'oz' ); ?>><?php esc_html_e( 'Ounces', 'woocommerce' ); ?></option>
		</select>
	</span>
	<?php

	return ob_get_clean();
}