• Resolved emko88

    (@emko88)


    Hi there!
    Really loving the WooCommerce Checkout Manager, however, I noticed that when the plugin is active my shipping rates do not automatically update when shipping country is changed at checkout. When I deactivated the plugin the shipping calculator worked as normal.

    I’m using:
    – WordPress 4.5.3
    – WooCommerce 2.6.3
    – WooCommerce Checkout Manager 4.0.8

    https://www.ads-software.com/plugins/woocommerce-checkout-manager/

Viewing 13 replies - 16 through 28 (of 28 total)
  • works! thx

    Woop! ??

    The fix is working fine. Thank you Michael!

    Thread Starter emko88

    (@emko88)

    Thanks again Michael! Everything is working fine for me as well! ??

    Hey Michael!

    I just tried the update, and it works in my dev environment – but not on the live site. My dev site uses an older version of php – the live site uses 5.6.25.

    The cart does now update when the state is changed, but not when the zip is changed. It’s the zip that drives the shipping rate, so changing the state isn’t enough.

    Any ideas for me?

    Thanks much!

    Hi heytricia, can you help me by confirming if the ZIP field has a ‘address-field’ CSS class assigned to it. You can see this within the source code or using the Web Developer Add-on within your browser.

    Hi Michael, i get endless spinning blockui overlay each time after select my city on checkout pages

    Hi Michael,
    I’ve the same issue than heytricia.
    My shipping costs also depends on the “Postcode / ZIP *” field and the cost does not refresh when these field is updated.
    To answer your question about CSS class, here is the HTML code of these field :

    <p class="form-row form-row address-field validate-required validate-postcode form-row-first woocommerce-validated" id="shipping_postcode_field" data-o_class="form-row form-row form-row-last address-field validate-required validate-postcode"><label for="shipping_postcode" class="">Postcode / ZIP <abbr class="required" title="required">*</abbr></label><input type="text" class="input-text " name="shipping_postcode" id="shipping_postcode" placeholder="" autocomplete="postal-code" value="33100"></p>

    Does that help you?
    Thanks.
    franck.

    Hey Michael:

    The input field does not have that class:

    <input type="text" class="input-text " name="shipping_postcode" id="shipping_postcode" placeholder="Postcode / Zip" value="80004-5438">

    I double checked to make sure I’m not overriding the Woocommerce template, but only have templates in place for the following:

    /woocommerce/archive-product.php,
    /woocommerce/cart/cart.php,
    /woocommerce/checkout/form-login.php

    Thanks for the quick response!

    Do I need to add an ‘address-field’ CSS class on my end so the shipping calculator will work properly and actually recalculate based on the new zip code entered? And if so, what are the steps involved that need to be performed? Thanks for your help.

    Hello,
    I’ve done some tests again and it’s worst than I thought.
    1/ The shipping calculator is not refreshed automatically when the user changes the delivery zip code
    2/ When the user force the refresh by switching the country to another then switching again to the good one, I noticed that the shipping cost is based on the invoicing zip code and not the shipping zip code! Which is a real problem.

    When I deactivate the plugin, everything is back to normal.

    Can these problem be fixed please?
    (I’m gonna open a new thread to follow your answer more easily)

    thank you.

    Hello Guys,

    I am using woocommerce v. 2.1.12.

    I have the same issue, my client wants. if buyer wants to change billing or checked different shipping address and change shipping country, shipping price must be calculated automatically on checkout page before confirm the order.

    Please reply on same, quick reply will be highly appreciated.

    Best regards,

    Imran

    By the way, I tried this below code to achieve my client ‘s requirements.

    ON JS FILE:
    jQuery(document).ready(function () {

    jQuery(‘#billing_country’).change(function () {

    var billingcountry = $(this).val();

    var billing_country = jQuery(‘#billing_country’).val();

    var data = {
    action: ‘woocommerce_apply_billing_country’,
    security: wc_checkout_params.apply_billing_country_nonce,
    billing_country: billing_country
    };
    jQuery.ajax({
    type: ‘POST’,
    url: wc_checkout_params.ajax_url,
    data: data,

    success: function (code) {

    alert (code +”Code”);

    },
    dataType: ‘html’
    });

    return false;
    });

    });

    ON FUNCTIONS.PHP FILE:

    wp_enqueue_script(‘billing_country’, get_template_directory_uri() . ‘/js/billing_country_call.js’, array(‘jquery’));
    wp_localize_script(‘billing_country’, ‘wc_checkout_params’, array(‘ajaxurl’ => admin_url(‘admin-ajax.php’)));

    add_action(‘woocommerce_apply_billing_country’, ‘calculate’, 10);
    add_action(‘wp_ajax_nopriv_woocommerce_apply_district’, ‘calculate’, 10);

    function calculate() {
    if (isset($_POST[‘billing_country’])) {

    global $woocommerce ;

    $order_shipping_total = 0;
    $billing_country = $_POST[‘billing_country’];

    if ( $billing_country == “US” ) {

    $order_shipping_total = 25;

    } else {

    $order_shipping_total = 50;
    }
    session_start();
    $_SESSION[‘val’] = $order_shipping_total;

    }
    }

    add_action(‘woocommerce_cart_calculate_fees’, ‘wpi_add_ship_fee’);

    function wpi_add_ship_fee() {
    @session_start();
    $customshipcost = $_SESSION[‘val’];
    WC()->cart->add_fee(‘Shipping :’, $customshipcost );
    }

    it returns zero right under subtotal on checkout page.

    any help will be highly appreciated.

    Best regards,

    Imran

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘WCM interferes with shipping calculator at checkout’ is closed to new replies.