diff --git a/classes/abstracts/abstract-wc-settings-api.php b/classes/abstracts/abstract-wc-settings-api.php index 5e0e9c01acb..848be17c4d9 100644 --- a/classes/abstracts/abstract-wc-settings-api.php +++ b/classes/abstracts/abstract-wc-settings-api.php @@ -206,6 +206,8 @@ abstract class WC_Settings_API { * @return string */ public function generate_text_html( $key, $data ) { + global $woocommerce; + $html = ''; $data['title'] = isset( $data['title'] ) ? $data['title'] : ''; @@ -214,6 +216,22 @@ abstract class WC_Settings_API { $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; $data['placeholder'] = isset( $data['placeholder'] ) ? $data['placeholder'] : ''; $data['type'] = isset( $data['type'] ) ? $data['type'] : 'text'; + $data['desc_tip'] = isset( $data['desc_tip'] ) ? $data['desc_tip'] : false; + $data['description'] = isset( $data['description'] ) ? $data['description'] : ''; + + // Description handling + if ( $data['desc_tip'] === true ) { + $description = ''; + $tip = $data['description']; + } elseif ( ! empty( $data['desc_tip'] ) ) { + $description = $data['description']; + $tip = $data['desc_tip']; + } elseif ( ! empty( $data['description'] ) ) { + $description = $data['description']; + $tip = ''; + } else { + $description = $tip = ''; + } // Custom attribute handling $custom_attributes = array(); @@ -225,11 +243,18 @@ abstract class WC_Settings_API { $html .= '' . "\n"; $html .= ''; $html .= ''; + + if ( $tip ) + $html .= ''; + $html .= '' . "\n"; $html .= '' . "\n"; $html .= '
' . wp_kses_post( $data['title'] ) . '' . "\n"; $html .= ''; - if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . wp_kses_post( $data['description'] ) . '

' . "\n"; } + + if ( $description ) + $html .= '

' . wp_kses_post( $description ) . '

' . "\n"; + $html .= '
'; $html .= '' . "\n"; $html .= '' . "\n"; @@ -247,12 +272,30 @@ abstract class WC_Settings_API { * @return string */ public function generate_password_html( $key, $data ) { + global $woocommerce; + $html = ''; $data['title'] = isset( $data['title'] ) ? $data['title'] : ''; $data['disabled'] = empty( $data['disabled'] ) ? false : true; $data['class'] = isset( $data['class'] ) ? $data['class'] : ''; $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; + $data['desc_tip'] = isset( $data['desc_tip'] ) ? $data['desc_tip'] : false; + $data['description'] = isset( $data['description'] ) ? $data['description'] : ''; + + // Description handling + if ( $data['desc_tip'] === true ) { + $description = ''; + $tip = $data['description']; + } elseif ( ! empty( $data['desc_tip'] ) ) { + $description = $data['description']; + $tip = $data['desc_tip']; + } elseif ( ! empty( $data['description'] ) ) { + $description = $data['description']; + $tip = ''; + } else { + $description = $tip = ''; + } // Custom attribute handling $custom_attributes = array(); @@ -264,11 +307,18 @@ abstract class WC_Settings_API { $html .= '' . "\n"; $html .= ''; $html .= ''; + + if ( $tip ) + $html .= ''; + $html .= '' . "\n"; $html .= '' . "\n"; $html .= '
' . wp_kses_post( $data['title'] ) . '' . "\n"; $html .= ''; - if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . wp_kses_post( $data['description'] ) . '

' . "\n"; } + + if ( $description ) + $html .= '

' . wp_kses_post( $description ) . '

' . "\n"; + $html .= '
'; $html .= '' . "\n"; $html .= '' . "\n"; @@ -286,12 +336,31 @@ abstract class WC_Settings_API { * @return string */ public function generate_textarea_html( $key, $data ) { + global $woocommerce; + $html = ''; $data['title'] = isset( $data['title'] ) ? $data['title'] : ''; $data['disabled'] = empty( $data['disabled'] ) ? false : true; $data['class'] = isset( $data['class'] ) ? $data['class'] : ''; $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; + $data['desc_tip'] = isset( $data['desc_tip'] ) ? $data['desc_tip'] : false; + $data['description'] = isset( $data['description'] ) ? $data['description'] : ''; + $data['placeholder'] = isset( $data['placeholder'] ) ? $data['placeholder'] : ''; + + // Description handling + if ( $data['desc_tip'] === true ) { + $description = ''; + $tip = $data['description']; + } elseif ( ! empty( $data['desc_tip'] ) ) { + $description = $data['description']; + $tip = $data['desc_tip']; + } elseif ( ! empty( $data['description'] ) ) { + $description = $data['description']; + $tip = ''; + } else { + $description = $tip = ''; + } // Custom attribute handling $custom_attributes = array(); @@ -303,11 +372,18 @@ abstract class WC_Settings_API { $html .= '' . "\n"; $html .= ''; $html .= ''; + + if ( $tip ) + $html .= ''; + $html .= '' . "\n"; $html .= '' . "\n"; $html .= '
' . wp_kses_post( $data['title'] ) . '' . "\n"; - $html .= ''; - if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . wp_kses_post( $data['description'] ) . '

' . "\n"; } + $html .= ''; + + if ( $description ) + $html .= '

' . wp_kses_post( $description ) . '

' . "\n"; + $html .= '
'; $html .= '' . "\n"; $html .= '' . "\n"; @@ -325,13 +401,31 @@ abstract class WC_Settings_API { * @return string */ public function generate_checkbox_html( $key, $data ) { + global $woocommerce; + $html = ''; $data['title'] = isset( $data['title'] ) ? $data['title'] : ''; $data['label'] = isset( $data['label'] ) ? $data['label'] : $data['title']; $data['disabled'] = empty( $data['disabled'] ) ? false : true; - $data['class'] = isset( $data['class'] ) ? $data['class'] : ''; - $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; + $data['class'] = isset( $data['class'] ) ? $data['class'] : ''; + $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; + $data['desc_tip'] = isset( $data['desc_tip'] ) ? $data['desc_tip'] : false; + $data['description'] = isset( $data['description'] ) ? $data['description'] : ''; + + // Description handling + if ( $data['desc_tip'] === true ) { + $description = ''; + $tip = $data['description']; + } elseif ( ! empty( $data['desc_tip'] ) ) { + $description = $data['description']; + $tip = $data['desc_tip']; + } elseif ( ! empty( $data['description'] ) ) { + $description = $data['description']; + $tip = ''; + } else { + $description = $tip = ''; + } // Custom attribute handling $custom_attributes = array(); @@ -341,12 +435,20 @@ abstract class WC_Settings_API { $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"'; $html .= '' . "\n"; - $html .= '' . $data['title'] . '' . "\n"; + $html .= '' . $data['title']; + + if ( $tip ) + $html .= ''; + + $html .= '' . "\n"; $html .= '' . "\n"; $html .= '
' . wp_kses_post( $data['title'] ) . '' . "\n"; $html .= '
' . "\n"; - if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . wp_kses_post( $data['description'] ) . '

' . "\n"; } + + if ( $description ) + $html .= '

' . wp_kses_post( $description ) . '

' . "\n"; + $html .= '
'; $html .= '' . "\n"; $html .= '' . "\n"; @@ -364,6 +466,8 @@ abstract class WC_Settings_API { * @return string */ public function generate_select_html( $key, $data ) { + global $woocommerce; + $html = ''; $data['title'] = isset( $data['title'] ) ? $data['title'] : ''; @@ -371,6 +475,22 @@ abstract class WC_Settings_API { $data['options'] = isset( $data['options'] ) ? (array) $data['options'] : array(); $data['class'] = isset( $data['class'] ) ? $data['class'] : ''; $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; + $data['desc_tip'] = isset( $data['desc_tip'] ) ? $data['desc_tip'] : false; + $data['description'] = isset( $data['description'] ) ? $data['description'] : ''; + + // Description handling + if ( $data['desc_tip'] === true ) { + $description = ''; + $tip = $data['description']; + } elseif ( ! empty( $data['desc_tip'] ) ) { + $description = $data['description']; + $tip = $data['desc_tip']; + } elseif ( ! empty( $data['description'] ) ) { + $description = $data['description']; + $tip = ''; + } else { + $description = $tip = ''; + } // Custom attribute handling $custom_attributes = array(); @@ -382,6 +502,10 @@ abstract class WC_Settings_API { $html .= '' . "\n"; $html .= ''; $html .= ''; + + if ( $tip ) + $html .= ''; + $html .= '' . "\n"; $html .= '' . "\n"; $html .= '
' . wp_kses_post( $data['title'] ) . '' . "\n"; @@ -392,7 +516,10 @@ abstract class WC_Settings_API { endforeach; $html .= ''; - if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . wp_kses_post( $data['description'] ) . '

' . "\n"; } + + if ( $description ) + $html .= '

' . wp_kses_post( $description ) . '

' . "\n"; + $html .= '
'; $html .= '' . "\n"; $html .= '' . "\n"; @@ -410,6 +537,8 @@ abstract class WC_Settings_API { * @return string */ public function generate_multiselect_html( $key, $data ) { + global $woocommerce; + $html = ''; $data['title'] = isset( $data['title'] ) ? $data['title'] : ''; @@ -417,6 +546,22 @@ abstract class WC_Settings_API { $data['options'] = isset( $data['options'] ) ? (array) $data['options'] : array(); $data['class'] = isset( $data['class'] ) ? $data['class'] : ''; $data['css'] = isset( $data['css'] ) ? $data['css'] : ''; + $data['desc_tip'] = isset( $data['desc_tip'] ) ? $data['desc_tip'] : false; + $data['description'] = isset( $data['description'] ) ? $data['description'] : ''; + + // Description handling + if ( $data['desc_tip'] === true ) { + $description = ''; + $tip = $data['description']; + } elseif ( ! empty( $data['desc_tip'] ) ) { + $description = $data['description']; + $tip = $data['desc_tip']; + } elseif ( ! empty( $data['description'] ) ) { + $description = $data['description']; + $tip = ''; + } else { + $description = $tip = ''; + } // Custom attribute handling $custom_attributes = array(); @@ -428,6 +573,10 @@ abstract class WC_Settings_API { $html .= '' . "\n"; $html .= ''; $html .= ''; + + if ( $tip ) + $html .= ''; + $html .= '' . "\n"; $html .= '' . "\n"; $html .= '
' . wp_kses_post( $data['title'] ) . '' . "\n"; @@ -438,7 +587,10 @@ abstract class WC_Settings_API { } $html .= ''; - if ( isset( $data['description'] ) && $data['description'] != '' ) { $html .= '

' . wp_kses_post( $data['description'] ) . '

' . "\n"; } + + if ( $description ) + $html .= '

' . wp_kses_post( $description ) . '

' . "\n"; + $html .= '
'; $html .= '' . "\n"; $html .= '' . "\n"; diff --git a/classes/class-wc-cart.php b/classes/class-wc-cart.php index deb67d8ede3..064742ef4d1 100644 --- a/classes/class-wc-cart.php +++ b/classes/class-wc-cart.php @@ -1578,13 +1578,15 @@ class WC_Cart { // Packages array for storing 'carts' $packages = array(); - $packages[0]['contents'] = $this->get_cart(); // Items in the package - $packages[0]['contents_cost'] = 0; // Cost of items in the package, set below - $packages[0]['applied_coupons'] = $this->applied_coupons; // Applied coupons - some, like free shipping, affect costs - $packages[0]['destination']['country'] = $woocommerce->customer->get_shipping_country(); - $packages[0]['destination']['state'] = $woocommerce->customer->get_shipping_state(); - $packages[0]['destination']['postcode'] = $woocommerce->customer->get_shipping_postcode(); - $packages[0]['destination']['city'] = $woocommerce->customer->get_shipping_city(); + $packages[0]['contents'] = $this->get_cart(); // Items in the package + $packages[0]['contents_cost'] = 0; // Cost of items in the package, set below + $packages[0]['applied_coupons'] = $this->applied_coupons; // Applied coupons - some, like free shipping, affect costs + $packages[0]['destination']['country'] = $woocommerce->customer->get_shipping_country(); + $packages[0]['destination']['state'] = $woocommerce->customer->get_shipping_state(); + $packages[0]['destination']['postcode'] = $woocommerce->customer->get_shipping_postcode(); + $packages[0]['destination']['city'] = $woocommerce->customer->get_shipping_city(); + $packages[0]['destination']['address'] = $woocommerce->customer->get_shipping_address(); + $packages[0]['destination']['address_2'] = $woocommerce->customer->get_shipping_address_2(); foreach ( $this->get_cart() as $item ) if ( $item['data']->needs_shipping() ) diff --git a/classes/gateways/bacs/class-wc-gateway-bacs.php b/classes/gateways/bacs/class-wc-gateway-bacs.php index 9a28b3bb689..dbd746ae83f 100644 --- a/classes/gateways/bacs/class-wc-gateway-bacs.php +++ b/classes/gateways/bacs/class-wc-gateway-bacs.php @@ -69,7 +69,8 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'Direct Bank Transfer', 'woocommerce' ) + 'default' => __( 'Direct Bank Transfer', 'woocommerce' ), + 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Customer Message', 'woocommerce' ), @@ -110,13 +111,11 @@ class WC_Gateway_BACS extends WC_Payment_Gateway { 'iban' => array( 'title' => __( 'IBAN', 'woocommerce' ), 'type' => 'text', - 'description' => __( 'Your bank may require this for international payments','woocommerce'), 'default' => '' ), 'bic' => array( 'title' => __( 'BIC (formerly Swift)', 'woocommerce' ), 'type' => 'text', - 'description' => __('Your bank may require this for international payments','woocommerce'), 'default' => '' ), diff --git a/classes/gateways/cheque/class-wc-gateway-cheque.php b/classes/gateways/cheque/class-wc-gateway-cheque.php index 278489b1a91..cf4e4256c43 100755 --- a/classes/gateways/cheque/class-wc-gateway-cheque.php +++ b/classes/gateways/cheque/class-wc-gateway-cheque.php @@ -63,7 +63,8 @@ class WC_Gateway_Cheque extends WC_Payment_Gateway { 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'Cheque Payment', 'woocommerce' ) + 'default' => __( 'Cheque Payment', 'woocommerce' ), + 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Customer Message', 'woocommerce' ), diff --git a/classes/gateways/cod/class-wc-gateway-cod.php b/classes/gateways/cod/class-wc-gateway-cod.php index 75aa323eb53..f274748cbe6 100644 --- a/classes/gateways/cod/class-wc-gateway-cod.php +++ b/classes/gateways/cod/class-wc-gateway-cod.php @@ -87,13 +87,14 @@ class WC_Gateway_COD extends WC_Payment_Gateway { 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'Payment method title that the customer will see on your website.', 'woocommerce' ), - 'default' => __( 'Cash on Delivery', 'woocommerce' ) + 'default' => __( 'Cash on Delivery', 'woocommerce' ), + 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Description', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'Payment method description that the customer will see on your website.', 'woocommerce' ), - 'default' => 'Pay with cash upon delivery.' + 'default' => 'Pay with cash upon delivery.', ), 'instructions' => array( 'title' => __( 'Instructions', 'woocommerce' ), @@ -108,7 +109,8 @@ class WC_Gateway_COD extends WC_Payment_Gateway { 'css' => 'width: 450px;', 'default' => '', 'description' => __( 'If COD is only available for certain methods, set it up here. Leave blank to enable for all methods.', 'woocommerce' ), - 'options' => $shipping_methods + 'options' => $shipping_methods, + 'desc_tip' => true, ) ); } diff --git a/classes/gateways/mijireh/class-wc-gateway-mijireh.php b/classes/gateways/mijireh/class-wc-gateway-mijireh.php index 3432de73c0c..79f7bed8ecc 100644 --- a/classes/gateways/mijireh/class-wc-gateway-mijireh.php +++ b/classes/gateways/mijireh/class-wc-gateway-mijireh.php @@ -164,13 +164,15 @@ class WC_Gateway_Mijireh extends WC_Payment_Gateway { 'title' => __( 'Access Key', 'woocommerce' ), 'type' => 'text', 'description' => __( 'The Mijireh access key for your store.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, ), 'title' => array( 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'Credit Card', 'woocommerce' ) + 'default' => __( 'Credit Card', 'woocommerce' ), + 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Description', 'woocommerce' ), diff --git a/classes/gateways/paypal/class-wc-gateway-paypal.php b/classes/gateways/paypal/class-wc-gateway-paypal.php index 00f66ebb527..c911e7b938b 100644 --- a/classes/gateways/paypal/class-wc-gateway-paypal.php +++ b/classes/gateways/paypal/class-wc-gateway-paypal.php @@ -125,7 +125,8 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'PayPal', 'woocommerce' ) + 'default' => __( 'PayPal', 'woocommerce' ), + 'desc_tip' => true, ), 'description' => array( 'title' => __( 'Description', 'woocommerce' ), @@ -137,13 +138,16 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { 'title' => __( 'PayPal Email', 'woocommerce' ), 'type' => 'email', 'description' => __( 'Please enter your PayPal email address; this is needed in order to take payment.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => 'you@youremail.com' ), 'invoice_prefix' => array( 'title' => __( 'Invoice Prefix', 'woocommerce' ), 'type' => 'text', 'description' => __( 'Please enter a prefix for your invoice numbers. If you use your PayPal account for multiple stores ensure this prefix is unqiue as PayPal will not allow orders with the same invoice number.', 'woocommerce' ), - 'default' => 'WC-' + 'default' => 'WC-', + 'desc_tip' => true, ), 'form_submission_method' => array( 'title' => __( 'Submission method', 'woocommerce' ), @@ -156,7 +160,9 @@ class WC_Gateway_Paypal extends WC_Payment_Gateway { 'title' => __( 'Page Style', 'woocommerce' ), 'type' => 'text', 'description' => __( 'Optionally enter the name of the page style you wish to use. These are defined within your PayPal account.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => __( 'Optional', 'woocommerce' ) ), 'shipping' => array( 'title' => __( 'Shipping options', 'woocommerce' ), diff --git a/classes/shipping/flat-rate/class-wc-shipping-flat-rate.php b/classes/shipping/flat-rate/class-wc-shipping-flat-rate.php index 7eddfe4746b..2086dac1310 100644 --- a/classes/shipping/flat-rate/class-wc-shipping-flat-rate.php +++ b/classes/shipping/flat-rate/class-wc-shipping-flat-rate.php @@ -85,6 +85,7 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method { 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), 'default' => __( 'Flat Rate', 'woocommerce' ), + 'desc_tip' => true ), 'cost_per_order' => array( 'title' => __( 'Cost per order', 'woocommerce' ), @@ -95,6 +96,8 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method { ), 'description' => __( 'Enter a cost (excluding tax) per order, e.g. 5.00. Leave blank to disable.', 'woocommerce' ), 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), 'availability' => array( 'title' => __( 'Method availability', 'woocommerce' ), @@ -117,7 +120,6 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method { 'type' => array( 'title' => __( 'Calculation Type', 'woocommerce' ), 'type' => 'select', - 'description' => '', 'default' => 'order', 'options' => array( 'order' => __( 'Per Order - charge shipping for the entire order as a whole', 'woocommerce' ), @@ -128,7 +130,6 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method { 'tax_status' => array( 'title' => __( 'Tax Status', 'woocommerce' ), 'type' => 'select', - 'description' => '', 'default' => 'taxable', 'options' => array( 'taxable' => __( 'Taxable', 'woocommerce' ), @@ -144,12 +145,16 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method { ), 'description' => __( 'Cost excluding tax. Enter an amount, e.g. 2.50.', 'woocommerce' ), 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), 'fee' => array( 'title' => __( 'Default Handling Fee', 'woocommerce' ), 'type' => 'text', 'description' => __( 'Fee excluding tax. Enter an amount, e.g. 2.50, or a percentage, e.g. 5%. Leave blank to disable.', 'woocommerce' ), 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), 'minimum_fee' => array( 'title' => __( 'Minimum Fee', 'woocommerce' ), @@ -160,12 +165,16 @@ class WC_Shipping_Flat_Rate extends WC_Shipping_Method { ), 'description' => __( 'Enter a minimum fee amount. Fee\'s less than this will be increased. Leave blank to disable.', 'woocommerce' ), 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), 'options' => array( 'title' => __( 'Shipping Options', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'Optional extra shipping options with additional costs (one per line). Example: Option Name|Cost|Per-order (yes or no). Example: Priority Mail|6.95|yes. If per-order is set to no, it will use the "Calculation Type" setting.', 'woocommerce' ), 'default' => '', + 'desc_tip' => true, + 'placeholder' => __( 'Option Name|Cost|Per-order (yes or no)', 'woocommerce' ) ), ); diff --git a/classes/shipping/free-shipping/class-wc-shipping-free-shipping.php b/classes/shipping/free-shipping/class-wc-shipping-free-shipping.php index c987a2c6738..8bda33f6fda 100644 --- a/classes/shipping/free-shipping/class-wc-shipping-free-shipping.php +++ b/classes/shipping/free-shipping/class-wc-shipping-free-shipping.php @@ -81,7 +81,8 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method { 'title' => __( 'Method Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'Free Shipping', 'woocommerce' ) + 'default' => __( 'Free Shipping', 'woocommerce' ), + 'desc_tip' => true, ), 'availability' => array( 'title' => __( 'Method availability', 'woocommerce' ), @@ -121,7 +122,9 @@ class WC_Shipping_Free_Shipping extends WC_Shipping_Method { 'min' => '0' ), 'description' => __( 'Users will need to spend this amount to get free shipping (if enabled above).', 'woocommerce' ), - 'default' => '0' + 'default' => '0', + 'desc_tip' => true, + 'placeholder' => '0.00' ) ); diff --git a/classes/shipping/international-delivery/class-wc-shipping-international-delivery.php b/classes/shipping/international-delivery/class-wc-shipping-international-delivery.php index c3489a27548..f44551e0e39 100644 --- a/classes/shipping/international-delivery/class-wc-shipping-international-delivery.php +++ b/classes/shipping/international-delivery/class-wc-shipping-international-delivery.php @@ -58,7 +58,8 @@ class WC_Shipping_International_Delivery extends WC_Shipping_Flat_Rate { 'title' => __( 'Method Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'International Delivery', 'woocommerce' ) + 'default' => __( 'International Delivery', 'woocommerce' ), + 'desc_tip' => true, ), 'availability' => array( 'title' => __( 'Availability', 'woocommerce' ), @@ -81,7 +82,6 @@ class WC_Shipping_International_Delivery extends WC_Shipping_Flat_Rate { 'type' => array( 'title' => __( 'Calculation Type', 'woocommerce' ), 'type' => 'select', - 'description' => '', 'default' => 'order', 'options' => array( 'order' => __( 'Per Order - charge shipping for the entire order as a whole', 'woocommerce' ), @@ -92,7 +92,6 @@ class WC_Shipping_International_Delivery extends WC_Shipping_Flat_Rate { 'tax_status' => array( 'title' => __( 'Tax Status', 'woocommerce' ), 'type' => 'select', - 'description' => '', 'default' => 'taxable', 'options' => array( 'taxable' => __( 'Taxable', 'woocommerce' ), @@ -107,13 +106,17 @@ class WC_Shipping_International_Delivery extends WC_Shipping_Flat_Rate { 'min' => '0' ), 'description' => __( 'Cost excluding tax. Enter an amount, e.g. 2.50.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), 'fee' => array( 'title' => __( 'Default Handling Fee', 'woocommerce' ), 'type' => 'text', 'description' => __( 'Fee excluding tax. Enter an amount, e.g. 2.50, or a percentage, e.g. 5%. Leave blank to disable.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), ); diff --git a/classes/shipping/local-delivery/class-wc-shipping-local-delivery.php b/classes/shipping/local-delivery/class-wc-shipping-local-delivery.php index cdbba6397ed..5c3687c43bb 100644 --- a/classes/shipping/local-delivery/class-wc-shipping-local-delivery.php +++ b/classes/shipping/local-delivery/class-wc-shipping-local-delivery.php @@ -104,7 +104,8 @@ class WC_Shipping_Local_Delivery extends WC_Shipping_Method { 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'Local Delivery', 'woocommerce' ) + 'default' => __( 'Local Delivery', 'woocommerce' ), + 'desc_tip' => true, ), 'type' => array( 'title' => __( 'Fee Type', 'woocommerce' ), @@ -116,6 +117,7 @@ class WC_Shipping_Local_Delivery extends WC_Shipping_Method { 'percent' => __( 'Percentage of cart total', 'woocommerce' ), 'product' => __( 'Fixed amount per product', 'woocommerce' ), ), + 'desc_tip' => true, ), 'fee' => array( 'title' => __( 'Delivery Fee', 'woocommerce' ), @@ -125,13 +127,17 @@ class WC_Shipping_Local_Delivery extends WC_Shipping_Method { 'min' => '0' ), 'description' => __( 'What fee do you want to charge for local delivery, disregarded if you choose free. Leave blank to disable.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => '0.00' ), 'codes' => array( 'title' => __( 'Zip/Post Codes', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'What zip/post codes would you like to offer delivery to? Separate codes with a comma. Accepts wildcards, e.g. P* will match a postcode of PE30.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => '12345, 56789 etc' ), 'availability' => array( 'title' => __( 'Method availability', 'woocommerce' ), diff --git a/classes/shipping/local-pickup/class-wc-shipping-local-pickup.php b/classes/shipping/local-pickup/class-wc-shipping-local-pickup.php index b90713c44d6..7c9802e91ba 100644 --- a/classes/shipping/local-pickup/class-wc-shipping-local-pickup.php +++ b/classes/shipping/local-pickup/class-wc-shipping-local-pickup.php @@ -84,13 +84,16 @@ class WC_Shipping_Local_Pickup extends WC_Shipping_Method { 'title' => __( 'Title', 'woocommerce' ), 'type' => 'text', 'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ), - 'default' => __( 'Local Pickup', 'woocommerce' ) + 'default' => __( 'Local Pickup', 'woocommerce' ), + 'desc_tip' => true, ), 'codes' => array( 'title' => __( 'Zip/Post Codes', 'woocommerce' ), 'type' => 'textarea', 'description' => __( 'What zip/post codes would you like to offer delivery to? Separate codes with a comma. Accepts wildcards, e.g. P* will match a postcode of PE30.', 'woocommerce' ), - 'default' => '' + 'default' => '', + 'desc_tip' => true, + 'placeholder' => '12345, 56789 etc' ), 'availability' => array( 'title' => __( 'Method availability', 'woocommerce' ),