• Resolved cpasquis

    (@cpasquis)


    Hi,

    Is there a way to exclude some carriers from the shipping field ? (in this case the free carriers)

    Thank you.

Viewing 1 replies (of 1 total)
  • Plugin Support Jeff Alvarez

    (@superlemon1998)

    Hi @cpasquis ,

    We currently do not support that feature so I’ll raise up a feature request for it but please keep in mind that I’m unable to provide any ETAs when this will be released.

    But it is possible via snippet, please use this:


    add_filter( 'adt_product_feed_shipping_data', function( $shipping_data, $product, $feed ) {

    // Shipping method labels to exclude (partial match, case-insensitive).
    $excluded_methods = array(
    'Local Pickup',
    'Express Post',
    'United Kingdom Shipping Flat rate GB',
    );

    return array_values( array_filter( $shipping_data, function( $method ) use ( $excluded_methods ) {
    foreach ( $excluded_methods as $excluded ) {
    if ( stripos( $method['service'] ?? '', $excluded ) !== false ) {
    return false;
    }
    }
    return true;
    } ) );

    }, 10, 3 );

    You will want to add the excluded_methods, Here’s how you can find the method labels: https://ibb.co/hFnWjHSF

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.