← All changes
|
includes/elementor/modules/checkout/templates/form-billing.php
+27
-10
1.3.2
→
2.7.0
View file →
| @@ -16,24 +16,36 @@ | ||
| 16 | 16 | * @global WC_Checkout $checkout |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | 19 | defined( 'ABSPATH' ) || exit; |
| 20 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals -- WooCommerce/Elementor template; variables mirror core docs. | |
| 21 | + | |
| 22 | + | |
| 23 | +$shipping_destination = get_option( 'woocommerce_ship_to_destination', true ); | |
| 24 | +$section_title = esc_html__( 'Billing details', 'sellkit' ); | |
| 25 | +$border_top = ''; | |
| 26 | + | |
| 27 | +if ( 'billing_only' === $shipping_destination ) { | |
| 28 | + $section_title = esc_html__( 'Billing & Shipping', 'sellkit' ); | |
| 29 | + $border_top = 'border-top'; | |
| 30 | +} | |
| 31 | + | |
| 20 | 32 | ?> |
| 21 | 33 | <div class="woocommerce-billing-fields sellkit-one-page-checkout-billing sellkit-checkout-local-fields"> |
| 22 | - <h4 class="sellkit-one-page-checkout-billing-header heading"> | |
| 23 | - <?php esc_html_e( 'Billing details', 'woocommerce' ); ?> | |
| 34 | + <h4 id="shipping_text_title" class="header heading" style="width:100%"> | |
| 35 | + <?php echo esc_html( $section_title ); ?> | |
| 24 | 36 | </h4> |
| 25 | 37 | <p class="billing-desc sub-heading"> |
| 26 | - <?php echo apply_filters( 'sellkit_core/widgets/checkout/custom_message/select_address_text', __( 'Select the address that matches your card or payment method.', 'sellkit' ) ); ?> | |
| 38 | + <?php echo wp_kses_post( apply_filters( 'sellkit_core/widgets/checkout/custom_message/select_address_text', esc_html__( 'Select the address that matches your card or payment method.', 'sellkit' ) ) ); ?> | |
| 27 | 39 | </p> |
| 28 | 40 | <?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?> |
| 29 | 41 | |
| 30 | - <?php if ( WC()->cart->needs_shipping() ) : // Display this section just if we need to ship products. ?> | |
| 42 | + <?php if ( WC()->cart->needs_shipping() && 'billing_only' !== $shipping_destination ) : // Display this section just if we need to ship products. ?> | |
| 31 | 43 | |
| 32 | 44 | <div class="billing-method" > |
| 33 | 45 | <div> |
| 34 | 46 | <label class="wrp method-a"> |
| 35 | - <input type="radio" value="same" name="billing-method" class="sellkit-billing-method-a"> | |
| 47 | + <input type="radio" value="same" name="billing-method" class="sellkit-billing-method-a" > | |
| 36 | 48 | <span class="checkmark"></span> |
| 37 | 49 | <span class="labels"><?php echo esc_html__( 'Same as shipping address', 'sellkit' ); ?></span> |
| 38 | 50 | </label> |
| 39 | 51 | </div> |
| @@ -39,9 +51,9 @@ | ||
| 39 | 51 | </div> |
| 40 | 52 | <hr> |
| 41 | 53 | <div> |
| 42 | 54 | <label class="wrp method-b"> |
| 43 | - <input type="radio" value="diff" name="billing-method" class="sellkit-billing-method-b" checked > | |
| 55 | + <input type="radio" value="diff" name="billing-method" class="sellkit-billing-method-b" <?php checked( true ); ?> > | |
| 44 | 56 | <span class="checkmark"></span> |
| 45 | 57 | <span class="labels"><?php echo esc_html__( 'Use a different billing address', 'sellkit' ); ?></span> |
| 46 | 58 | </label> |
| 47 | 59 | </div> |
| @@ -48,9 +60,9 @@ | ||
| 48 | 60 | </div> |
| 49 | 61 | |
| 50 | 62 | <?php endif; ?> |
| 51 | 63 | |
| 52 | - <div class="woocommerce-billing-fields__field-wrapper" id="sellkit-checkout-billing-field-wrapper"> | |
| 64 | + <div class="woocommerce-billing-fields__field-wrapper <?php echo esc_attr( $border_top ); ?>" id="sellkit-checkout-billing-field-wrapper"> | |
| 53 | 65 | <?php |
| 54 | 66 | $fields = $checkout->get_checkout_fields( 'billing' ); |
| 55 | 67 | |
| 56 | 68 | do_action( 'sellkit_checkout_billing_fields', $fields, $checkout ); |
| @@ -56,9 +68,14 @@ | ||
| 56 | 68 | do_action( 'sellkit_checkout_billing_fields', $fields, $checkout ); |
| 57 | 69 | ?> |
| 58 | 70 | </div> |
| 59 | 71 | |
| 72 | + <?php if ( 'billing_only' === $shipping_destination ) : ?> | |
| 73 | + | |
| 74 | + <div class="sellkit-woocommerce-additional-fields"> | |
| 75 | + <?php do_action( 'woocommerce_after_order_notes', $checkout ); ?> | |
| 76 | + </div> | |
| 77 | + | |
| 78 | + <?php endif; ?> | |
| 79 | + | |
| 60 | 80 | <?php do_action( 'woocommerce_after_checkout_billing_form', $checkout ); ?> |
| 61 | - <div class="sub-heading"> | |
| 62 | - <?php wc_get_template( 'checkout/terms.php' ); ?> | |
| 63 | - </div> | |
| 64 | 81 | </div> |