Woocommerce Advanced Shipping (WAS) condition is not being called when selecting “Ship to different address” [closed]

Your code is good and shouldn’t be the issue (as long as the shipping rate is active/published and has the condition).

I think its related to the shipping cache; WC doesn’t re-calculate the shipping cost if nothing has changed for the destination (so the billing would be the same as the shipping address).

You can test this by enabling the Shipping debug mode under the ‘Shipping’ settings since WC 3.0, before that under System status > Tools.

If that works and it is calling the function now; you can resolve it completely by adding the value of the checkbox to the shipping package.

function custom_add_package_var( $package ) {
    $package['destination']['ship_to_diff_address'] = $my_var;
    return $package;
}
add_filter( 'woocommerce_cart_shipping_packages', 'custom_add_package_var' );

(non-functional code above; going from where you got so far I believe this would be enough for you to work with 😉

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)