What I'm trying to accomplish: In woocommerce, I need to check the date sent using the datepicker field when the user selects the date and then updates the delivery parameters accordingly via ajax so that things like free shipping can be exported when they do not fit.
What I currently know / understood: I am currently triggering a jQuery event and dispatch it through the user script date I need. I could not find a function in the woocommerce classes that returns only delivery data, so I don’t think I can name it and return it as a fragment, as is done for verification.
However, I found that
WC_AJAX::update_order_review()
has an action call inside it, and I successfully connected the function to this action, and I was able to disable
t( 'body' ).trigger( 'update_checkout' );
which disables the action that updates the validation check block.
My real question is: All this is great, and I look like its title is in the right direction, but I don’t know woocommerce well enough to know how to get the delivery methods inside my connected action to cancel them as necessary. Does anyone know if I can get them through the global $ woocommerce object and then ask them to read the rest of this WC_AJAX method?
Any help here would be greatly appreciated.
** Notes: yes, I know that it is "t", not "$" in jQuery. No mistake
ajax php wordpress datepicker woocommerce
Trevor Miles Wagner
source share