Он добавляет флажок, но не убирает его, что не так сделал?
<ul id="shipping_method" class="woocommerce-shipping-methods">
<li>
<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_local_pickup18" value="local_pickup:18" class="shipping_method" checked="checked"><label for="shipping_method_0_local_pickup18">Самовывоз</label>
</li>
<li>
<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_nova_poshta_shipping19" value="nova_poshta_shipping:19" class="shipping_method"><label for="shipping_method_0_nova_poshta_shipping19"><span id="wcus-shipping-cost">Новая почта</span></label><input id="wcus-shipping-name" type="hidden" value="Новая почта">
</li>
<li>
<input type="radio" name="shipping_method[0]" data-index="0" id="shipping_method_0_flat_rate25" value="flat_rate:25" class="shipping_method"><label for="shipping_method_0_flat_rate25">Курьером</label>
</li>
</ul>
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
<input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" type="checkbox" name="ship_to_different_address" value="1"> <span>Доставить на другой адрес?</span>
</label>
ul li {
list-style-type: none;
}
$(function () {
$("#shipping_method_0_flat_rate25").on("change", function () {
if ($("#shipping_method_0_flat_rate25").prop("checked")) {
$("#ship-to-different-address-checkbox").attr("checked", true);
} else {
$("#ship-to-different-address-checkbox").attr("checked", false);
}
});
});