• Resolved e061070

    (@e061070)


    Hi, until a few months ago it was possible with a snippet if I had a coupon to deactivate some fields, now the snippet only works if I deactivate the plugin it is as if they conflicted, leaving it active does not remove any fields

    add_filter( 'woocommerce_checkout_fields' , 'remove_fields_checkout' );
    function remove_fields_checkout( $fields ) {
    if (!empty(WC()->cart->applied_coupons)){
    if (in_array("summer", WC()->cart->applied_coupons)) {
    //unset($fields['billing']['billing_first_name']);
    //unset($fields['billing']['billing_last_name']);
    unset($fields['billing']['billing_address_1']);
    unset($fields['billing']['billing_address_2']);
    unset($fields['billing']['billing_city']);
    unset($fields['billing']['billing_postcode']);
    unset($fields['billing']['billing_country']);
    unset($fields['billing']['billing_state']);
    unset($fields['billing']['billing_phone']);
    unset($fields['billing']['billing_wooccm11']);
    unset($fields['billing']['billing_wooccm12']);
    unset($fields['billing']['billing_wooccm16']);
    //unset($fields['billing']['billing_company']);
    //unset($fields['billing']['billing_email']);
    unset($fields['order']['order_comments']);
    }
    }
    return $fields;
    }

    Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support jmatiasmastro

    (@jmatiasmastro)

    @e061070

    Hello mate, could you please tell us with which version of our plugin you are experiencing this issue that you are reporting and with which one did it work correctly?

    Best regards, QuadLayers Support Team.

    Thread Starter e061070

    (@e061070)

    Hi, solved, I added a value to run the snippet after the plugin (9999)

    add_filter( ‘woocommerce_checkout_fields’ , ‘remove_fields_checkout’,9999 );
    function remove_fields_checkout( $fields ) {

    *********

    version: 6.4.3
    name: Storefront (storefront)
    version: 4.5.4
    Checkout Field Editor for WooCommerce: version: 2.0.1, author: ThemeHigh, Auto-updates disabled
    Classic Editor: version: 1.6.3, author: WordPress Contributors, Auto-updates disabled
    Flexible Checkout Fields: version: 4.1.1, author: WP Desk, Auto-updates disabled
    Flexible Checkout Fields PRO: version: 3.5.11, author: WP Desk, Auto-updates disabled
    extension: mysqli
    server_version: 8.0.16
    client_version: mysqlnd 8.1.23

    *********
    tnx

    • This reply was modified 8 months, 3 weeks ago by e061070.
    Plugin Support jmatiasmastro

    (@jmatiasmastro)

    @e061070 Hi mate, I want to clarify that “Flexible Checkout Fields” plugin is not associated with QuadLayers. Our plugin is “Checkout Manager for WooCommerce”.

    Best regards, QuadLayers Support Team.

    Thread Starter e061070

    (@e061070)

    Yes thanks, in fact it was a test done with another plugin, but they are deactivated, now deleted, the error was given to me with yours, but as I wrote to you it is solved

    tnx

    e.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Snippet remove fields checkout’ is closed to new replies.