I'm using woocommerce and found out that I'm able to hide shipping method when free shipping is available.

but the problem now is I need to hide two instead of one. when ever I try hiding two methods my whole page go black.

I need expert to help me solve it. thanks a million in advance!!

```
// Hide standard shipping option when free shipping is available
add_filter( 'woocommerce_available_shipping_methods', 'hide_standard_shipping_when_free_is_available' , 10, 1 );

/**
 *  Hide Standard Shipping option when free shipping is available
 * 
 * @param array $available_methods
 */
function hide_standard_shipping_when_free_is_available( $available_methods ) {

    if( isset( $available_methods['free_shipping'] ) AND isset( $available_methods['local_delivery'], ['flat_rate'] ) ) {

        // remove standard shipping option
        unset( $available_methods['local_delivery'], ['flat_rate'] );
    }

    return $available_methods;
}

```