WC_Admin_Setup_Wizard::get_product_weight_selection
Deprecated since 4.6.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Render a product weight unit dropdown.
Method of the class: WC_Admin_Setup_Wizard{}
No Hooks.
Returns
String|false.
Usage
// protected - for code of main (parent) or child class $result = $this->get_product_weight_selection();
Changelog
| Deprecated since | 4.6.0 |
WC_Admin_Setup_Wizard::get_product_weight_selection() WC Admin Setup Wizard::get product weight selection code WC 10.6.2
<?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();
}