• Resolved sebbs121

    (@sebbs121)


    Hello,

    I need to update price and currency after user select billing country

    add_action(‘wp_footer’, ‘billing_country_update_checkout’, 50);
    function billing_country_update_checkout() {
    if ( ! is_checkout() ) return;
    ?>
    <script type=”text/javascript”>
    jQuery(function($){
    $(‘select#billing_country, select#shipping_country’).on( ‘change’, function (){
    document.getElementById(‘totalSum’).innerHTML = ‘<?php echo WC()->cart->get_cart_contents_total(); ?>’;
    });
    });
    </script>
    <?php
    }

    So far I did this ^, but price is all the time the same.. Price isn’t adequate to selected country (I’ve set prices manually for each pricing zone). Any ideas?

Viewing 1 replies (of 1 total)
  • Plugin Author Oscar Gare

    (@oscargare)

    Hi,
    by default, when the user change the billing/shipping country on the checkout page, the product price (and currency) should change according. You don’t need to add any code, WooCommerce refreshes the <div id=”order_review”> via AJAX.

    Please, do a test with the default WordPress theme, or the Storefront theme. Make sure you uncheck “Ship to a different address?” on the checkout page.

Viewing 1 replies (of 1 total)
  • The topic ‘Update checkout price based on selected billing country’ is closed to new replies.