How to update shipping cost on the checkout page?

Customizing page checkout, added a block, where the idea must be displayed for the selected delivery.
It looks like this:
<div class="subtotal-form__shipping">
 <span class="subtotal-form__shipping-label">shipping: </span>
 <span class="subtotal-form__shipping-price">
 <?php if (WC()->cart->get_shipping_total() && WC()->cart->get_shipping_total() > 0) :
 echo WC()->cart->get_shipping_total(); ?>
 <span class="woocommerce-Price-currencySymbol">
 <?php echo get_woocommerce_currency_symbol(); ?>
</span>
 <?php else :
 echo 'free';
 endif; ?>
</span>
</div>


how to update field when you change the shipping method without reloading the page?
April 7th 20 at 15:29
1 answer
April 7th 20 at 15:31
Without restarting it means well, or ajax rest api wp to use.
and see the link

Find more questions by tags WooCommerceWordPress