check shipping amount in woocommerce_after_checkout_validation?


I am using a third-party shipping plugin. Sometimes, this plugin somehow acts up, and only charges the client something like 1$.

I’d like to add a sanity check before the order is accepted, that the shipping amount should at least be e.g. 3$.

It seems that I should hook into woocommerce_after_checkout_validation to do this there.

But the shipping amount doesn’t seem to be in $_POST – the only thing of interest is maybe ‘shipping_method’, but there’s no amount to be seen (i just used flat rate as a test):

  array(1) {
    string(11) "flat_rate:4"

How can I look up how much shipping is planned to being charged on the order that has just been submitted?

, Moritz von Schweinitz 4 years 2020-07-20T19:10:26-05:00 0 Answers 57 views 0

Leave an answer