What i'm trying to accomplish: In woocommerce, I need to check a date delivered via a datepicker field when user selects a date, and then update shipping options accordingly via ajax, so that things like free shipping can be taken out when they are not appropriate.
What I currently know/have figured out: I currently have the jQuery event firing and sending through a date to a custom script, which is kinda where I need to do. I have not been able to find a function within woocommerce classes that returns just the shipping data, so I don't think I can call that and return it as a fragment, as they do for the checkout already.
However, I did find that
WC_AJAX::update_order_review()
has an action call within it, and I have successfully hooked a function onto that action, AND i've been able to fire off the
t( 'body' ).trigger( 'update_checkout' );
which fires off the action that updates the checkout review block.
My real question: All this is great, and I'ts looking like its heading in the right direction, but I don't know woocommerce well enough to know how to get the shipping methods within my hooked action to unset them as necessary. Does anyone know if I can get them through the $woocommerce global object, and then have them be read by the rest of that WC_AJAX method??
Any help here would be greatly appreciated.
** notes: yes, I know thats a 't' and not a '$' in the jQuery. Not a mistake