R
R
Roman Govorov2019-06-24 17:13:35
WordPress
Roman Govorov, 2019-06-24 17:13:35

How to add city input to WordPress Woocommrerce delivery block?

5d10da86bbc67775108296.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Govorov, 2019-06-25
@RGameShow

If anyone is interested in solving this issue, then I did the following: I
uploaded the file from the plugin /wp-content/plugins/woocommerce/cart/cart-shipping.php
to my theme /wp-content/themes/rstheme/woocommerce/cart/ cart-shipping.php
And pasted the following code before the opening ul tag with woocommerce-shipping-methods class

<li>
    <div class="address-field" data-priority="40">
        <label for="billing_city" class="">Укажите город:
            <span class="woocommerce-input-wrapper">
              <input type="text" class="input-text mt-1 m-0" id="demo1" name="billing_city">
            </span>
        </label>
    </div>
    <script>
        $(document).ready(function() {
            var b = $('#billing_city').val();
            $('#demo1').attr('value', b);
        });
        $('#demo1').keyup(function() {
            var a = $(this).val();
            $('#billing_city').attr('value', a);
        });
    </script>
</li>

And the city which is in the payment details, hid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question