배송 옵션이 업데이트되고 체크 아웃 페이지에서 ajax 호출을 통해 jQuery 함수가 초기화되어야하며 Woocommerce 사용자 지정 이벤트 updated_shipping_method
이 트리거되었습니다.WooCommerce AJAX 출하 방법 업데이트 후 jQuery 실행
내 jQuery 스 니펫이이 이벤트를 수신하도록 설정되었지만 의도 한대로 작동하지 않습니다.
jQuery(document.body).on('updated_shipping_method', function(){
// Code stuffs
// has the function initialized after the event trigger?
console.log('on updated_shipping_method: function fired');
});
나는 아무 소용뿐만 아니라 updated_wc_div
사용자 정의 이벤트를 시도했습니다.
거의 비슷한 방법으로 장바구니 페이지에서 updated_cart_totals
에 대한 맞춤 이벤트 트리거를 수신하고 완벽하게 작동합니다. 체크 아웃 페이지의 경우가 아닌 이유를 잘 모릅니다.