B
B
blindmen2015-10-12 17:09:48
JavaScript
blindmen, 2015-10-12 17:09:48

Woocomerce what happens during checkout?

You need to change the shipping cost directly in the shopping cart at checkout.
we initially have a shipping cost of 500 rubles, using the js (ymaps api) method we find out the shipping costs and get 1000 rubles.
how can I either change the shipping cost, or intercept (I can’t find the file in which the delivery form is being processed) the data sent for processing and change it there. so that in the formed order for delivery there was a cost of 1000 rubles.
Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MetaDone, 2015-10-12
@blindmen

add_action('woocommerce_new_order', "your_function");

Hook to create an order, then you can do this
function your_function($order_id){
$order = new WC_Order($order_id);
$order->set_total("1000","shipping");
}

It should work, more specifically for your needs, add

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question