D
D
Dmitry Klimantovich2019-10-09 12:58:30
WordPress
Dmitry Klimantovich, 2019-10-09 12:58:30

How to display only certain Checkout fields?

By default in Woocommerce, in the form-billing.php file, all form fields that I edited through Saphali WC are called.

<div class="woocommerce-billing-fields__field-wrapper">
    <?php
    $fields = $checkout->get_checkout_fields( 'billing' );

    foreach ( $fields as $key => $field ) {
      woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
    }
    ?>
</div>

In my case, this code calls the fields:
  • Telephone
  • Email
  • Recipient name (optional)
  • Delivery address *
  • Recipient's phone *
  • Delivery date *
  • Time of delivery *

And I need it to be like this:
Heading H2
  • Telephone
  • Email

Then insert the choice of delivery here.
Then the H2 Heading
And then the rest of the fields:
  • Recipient name (optional)
  • Delivery address *
  • Recipient's phone *
  • Delivery date *
  • Time of delivery *

How to do this please tell me.
I use Saphali Woocommerce to set up the fields, but there is no way to insert a title between the fields.
Essentially, you need something like this:5da32a1af034d728259214.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question