• I′m trying to unset local_delivery depended on a cookie value but it only works after I updated something in my cart and click on update cart. How do I get around that? My code:

    add_filter('woocommerce_available_shipping_methods', 'hide_local_delivery_when_not_available');
    
    function hide_local_delivery_when_not_available( $available_methods ) {
    if (date("Y-m-d") > $_COOKIE['teamdelivery_date']){
    // remove local shipping option
    unset( $available_methods['local_delivery'] );
    }
    return $available_methods;
    }

    https://www.ads-software.com/plugins/woocommerce/

  • The topic ‘Shipping method depended on cookie value, update problem’ is closed to new replies.