update_order_review( ) on button click

前端 未结 2 2141
离开以前
离开以前 2021-02-15 05:39

I have a custom button on my checkout page, on click I\'m adding a product to cart via AJAX.

JS:

$(\'#add_domain_product\').on(\'click\', function() {
          


        
2条回答
  •  北恋
    北恋 (楼主)
    2021-02-15 06:00

    All you need to do is call a trigger on the body to update the cart.

    $( 'body' ).trigger( 'update_checkout' );
    

    This will automatically call all the subsequent AJAX calls needed to refresh the cart information, including the order review.

提交回复
热议问题