Completely new to Woocommerce/wordpress here. On the cart page mydomain.local/cart
What filter should I use to show/hide a flat rate shipping method at certain times. From admin I managed to add an extra flat rate method and named it "Next day". Now I would like to show that flat rate method only before 4PM. I tried in functions.php
add_filter( 'woocommerce_package_rates', 'custom_change_shipping', 10);
function custom_change_shipping($rates) {
var_dump($rates);
}
Nothing seems to change and also I cant seem to debug the $rates
variable as nothing is outputted when var_dump($rates);
. I tried it both anonymous and as an admin but nothing seems to work.