WC_Settings_Shipping::get_settings_for_options_section
Get settings for the options section.
Method of the class: WC_Settings_Shipping{}
Hooks from the method
Returns
Array.
Usage
// protected - for code of main (parent) or child class $result = $this->get_settings_for_options_section();
WC_Settings_Shipping::get_settings_for_options_section() WC Settings Shipping::get settings for options section code WC 10.5.0
protected function get_settings_for_options_section() {
$settings =
array(
array(
'title' => __( 'Shipping settings', 'woocommerce' ),
'type' => 'title',
'id' => 'shipping_options',
),
array(
'title' => __( 'Calculations', 'woocommerce' ),
'desc' => __( 'Enable the shipping calculator on the cart page', 'woocommerce' ),
'id' => 'woocommerce_enable_shipping_calc',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'autoload' => false,
),
array(
'desc' => __( 'Hide shipping costs until an address is entered', 'woocommerce' ),
'id' => 'woocommerce_shipping_cost_requires_address',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => '',
),
array(
'desc' => __( 'Hide shipping rates when free shipping is available', 'woocommerce' ),
'id' => 'woocommerce_shipping_hide_rates_when_free',
'default' => 'no',
'type' => 'checkbox',
'autoload' => false,
'checkboxgroup' => 'end',
),
array(
'title' => __( 'Shipping destination', 'woocommerce' ),
'desc' => __( 'This controls which shipping address is used by default.', 'woocommerce' ),
'id' => 'woocommerce_ship_to_destination',
'default' => 'billing',
'type' => 'radio',
'options' => array(
'shipping' => __( 'Default to customer shipping address', 'woocommerce' ),
'billing' => __( 'Default to customer billing address', 'woocommerce' ),
'billing_only' => __( 'Force shipping to the customer billing address', 'woocommerce' ),
),
'autoload' => false,
'desc_tip' => true,
'show_if_checked' => 'option',
),
array(
'title' => __( 'Debug mode', 'woocommerce' ),
'desc' => __( 'Enable debug mode', 'woocommerce' ),
'desc_tip' => __( 'Enable shipping debug mode to show matching shipping zones and to bypass shipping rate cache.', 'woocommerce' ),
'id' => 'woocommerce_shipping_debug_mode',
'default' => 'no',
'type' => 'checkbox',
),
array(
'type' => 'sectionend',
'id' => 'shipping_options',
),
);
return apply_filters( 'woocommerce_shipping_settings', $settings );
}