• Resolved studioartesia

    (@studioartesia)


    I can’t place the eu VAT field above all the checkbox fields, although I have set the sorting value in the settings. Probably because the checkbox fields are managed and created by a third plug-in different from the default woocommerce checkout

    Is there a code to insert in the functions.php to move the field above everything?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Diego

    (@daigo75)

    If you wish to change the position of the VAT number field, you can set a priority to a lower number (the lower the number, the higher it will appear on the checkout page). The highest place is “1”, above everything else.

    If you wish to modify the field’s position, or other attributes, via code, you can use the standard woocommerce_checkout_fields filter (see https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/). The VAT number field’s attributes are in $fields['billing']['vat_number'].

    If that doesn’t work either, then you will have to figure how the “checkbox fields” are added, and position them lower instead.

    Thread Starter studioartesia

    (@studioartesia)

    This code is right ??

    add_filter(“woocommerce_checkout_fields”, “order_fields”, 1);
    function order_fields($fields) {
    $fields[‘billing’][‘vat_number’][“priority”] = 1;
    return $fields;
    }

    Plugin Author Diego

    (@daigo75)

    Yes, that code looks right. Please be aware that, as it is, it will position the VAT number field at the very top of the checkout page (at least, on a “standard” WooCommerce site).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Position EU VAT FILEDS’ is closed to new replies.