flexible-shipping.php
62 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Settings for flexible shipment |
| 4 | * |
| 5 | * @package FlexibleShipping |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; |
| 10 | } |
| 11 | |
| 12 | $docs_link = get_locale() === 'pl_PL' ? 'https://octol.io/fs-docs-pl' : 'https://octol.io/fs-docs'; |
| 13 | |
| 14 | $settings = array( |
| 15 | array( |
| 16 | 'title' => __( 'Flexible Shipping', 'flexible-shipping' ), |
| 17 | 'type' => 'title', |
| 18 | // Translators: link. |
| 19 | 'description' => sprintf( __( 'See how to %1$sconfigure Flexible Shipping%2$s.', 'flexible-shipping' ), '<a href="' . $docs_link . '" target="_blank">', '</a>' ), |
| 20 | 'default' => '', |
| 21 | ), |
| 22 | 'enabled' => array( |
| 23 | 'title' => __( 'Enable/Disable', 'flexible-shipping' ), |
| 24 | 'type' => 'checkbox', |
| 25 | 'label' => __( 'Enable Flexible Shipping', 'flexible-shipping' ), |
| 26 | 'default' => 'no', |
| 27 | ), |
| 28 | 'title' => array( |
| 29 | 'title' => __( 'Shipping title', 'flexible-shipping' ), |
| 30 | 'type' => 'text', |
| 31 | 'description' => __( 'Visible only to admin in WooCommerce settings.', 'flexible-shipping' ), |
| 32 | 'default' => __( 'Flexible Shipping', 'flexible-shipping' ), |
| 33 | 'desc_tip' => true, |
| 34 | ), |
| 35 | 'tax_status' => array( |
| 36 | 'title' => __( 'Tax Status', 'flexible-shipping' ), |
| 37 | 'type' => 'select', |
| 38 | 'default' => 'taxable', |
| 39 | 'desc_tip' => __( 'If you select to apply the tax, the plugin will use the tax rates defined in the WooCommerce settings at <strong>WooCommerce → Settings → Tax</strong>.', 'flexible-shipping' ), |
| 40 | 'options' => array( |
| 41 | 'taxable' => __( 'Taxable', 'flexible-shipping' ), |
| 42 | 'none' => _x( 'None', 'Tax status', 'flexible-shipping' ), |
| 43 | ), |
| 44 | ), |
| 45 | 'title_shipping_methods' => array( |
| 46 | 'title' => __( 'Shipping Methods', 'flexible-shipping' ), |
| 47 | 'type' => 'title_shipping_methods', |
| 48 | 'description' => '', |
| 49 | ), |
| 50 | 'shipping_methods' => array( |
| 51 | 'title' => __( 'Shipping Methods', 'flexible-shipping' ), |
| 52 | 'type' => 'shipping_methods', |
| 53 | 'desc_tip' => true, |
| 54 | ), |
| 55 | ); |
| 56 | |
| 57 | if ( version_compare( WC()->version, '2.6' ) >= 0 && $this->get_option( 'enabled', 'yes' ) == 'yes' ) { |
| 58 | unset( $settings['enabled'] ); |
| 59 | } |
| 60 | |
| 61 | return $settings; |
| 62 |