• Resolved Rune Rasmussen

    (@syntaxerrorno)


    Noticed the themes setting for disabling/hiding the order note field in checkout have no effect, nor does the filter:

    add_filter( 'woocommerce_enable_order_notes_field', '__return_false', 9999 );

    So without checking any deeper in your plugin I just assume you have some own logic loading it no matter what, and thus I would request adding a setting for it in the plugin, as some store owners doesn’t want to have the field available in checkout.

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

    (@thegeneration)

    Hi,

    You are correct, in the current version that filter is not being used. In the upcoming version 3.0.0 more of the default WooCommerce templates will be used and thus making that filter work.

    If you’d like to remove the order notes field in the current version we suggest overwriting the template in your child theme instead.

    Best regards

    Thread Starter Rune Rasmussen

    (@syntaxerrorno)

    Sounds great regarding the 3.0.0 version, looking forward to testing it, hopefully it will solve all known issues and limitations then. ??

    Thread Starter Rune Rasmussen

    (@syntaxerrorno)

    For others wondering, while we wait for the new release:

    If you’d like to remove the order notes field in the current version we suggest overwriting the template in your child theme instead.

    The code in svea-checkout.php loading the order note field is as follows, which means you might end up removing other things also if removing/commenting it:

                    <div class="wc-svea-checkout-other-fields">
    <?php foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) : ?>
    <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
    <?php endforeach; ?>
    </div>

    So maybe instead just add a custom filter to functions.php or a code snippet plugin:

    add_filter( 'woocommerce_checkout_fields' , 'remove_order_notes_field', 20, 1 );
    function remove_order_notes_field( $fields ) {
    unset($fields['order']['order_comments']);
    return $fields;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.