Support » Plugin: Shiprocket » Plugin features not working

  • Hi,

    1. I want to remove “Check Pincode” feature from my site as it’s not working. How can I do so? It says “This pincode is not serviceable!” for every pincode entered.

    2. It’s also not showing the estimated delivery date and time as stated in the plugin features.

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • mozvilla

    (@mozvilla)

    Hi,

    The “Check Pincode” and the plugin itself works when you update all your products with shipping parameters like dimensions (length, width, height) and weight information in kg, cm etc.

    I resolved my similar issues through it.

    Thanks

    HI,

    I’ve updated dimensions and weight information of all products. But still all pincodes are showing as non-servicable.

    REMOVE THIS BELOW CODE FROM wp-content/plugins/shiprocket/shiprocket-woocommerce-shipping-calculator.php
    LINE NO: 223

    add_action(‘woocommerce_single_product_summary’, ‘shiprocket_show_check_pincode’, 20);

    /**
    * Show an option to check serviceability to a pincode
    *
    * @return null
    */
    function Shiprocket_Show_Check_pincode()
    {

    global $product;

    $settings = get_option(‘woocommerce_shiprocket_woocommerce_shipping_settings’);

    if (!isset($settings[‘integration_id’])) {
    return true;
    }

    ?>
    <div>
    <input type=”text” id=”shiprocket_pincode_check” name=”shiprocket_pincode_check” value=”” placeholder=”Enter Pincode”>

    <button id=”check_pincode” onClick=”checkPincode()”> Check Pincode </button>
    </div>
    <div><p id=”pincode_response”></p></div>

    <script>
    function checkPincode() {
    var pincode = document.getElementById(“shiprocket_pincode_check”).value;
    if(pincode == ”){
    jQuery(‘#pincode_response’).text(“This pincode field is required!”)
    }else{
    var url = “<?php echo SHIPROCKET_WC_RATE_URL; ?>”;

    url += “?weight=” + “<?php echo $product->weight; ?>” + “&cod=1&delivery_postcode=” + pincode;

    url += “&store_url=” + “<?php echo get_site_url(); ?>”;

    url += “&merchant_id=” + “<?php echo $settings[‘integration_id’];?>”;

    url += “&unit=” + “<?php echo get_option(‘woocommerce_weight_unit’);?>”;

    var token = ‘ACCESS_TOKEN:’ + ‘<?php echo SHIPROCKET_ACCESS_TOKEN; ?>’;

    jQuery.ajax({
    url: url,
    headers: {‘authorization’: token},
    success: function(response) {
    if(response.status == 200) {
    var recommeded_courier_id = response.data.recommended_courier_company_id;
    var available_couriers = response.data.available_courier_companies;
    var recommeded_courier = available_couriers.filter(c => c.courier_company_id == recommeded_courier_id);
    if(recommeded_courier_id !== null && recommeded_courier_id !== ”){
    var recommeded_courier = available_couriers.filter(c => c.courier_company_id == recommeded_courier_id);
    var etd = recommeded_courier[0].etd;
    }else{
    var etd = available_couriers[0].etd;
    }
    var msg = <span>You'll get your product by <strong> + etd + </strong> !</span>;

    jQuery(‘#pincode_response’).html(msg);
    }
    else {
    jQuery(‘#pincode_response’).text(“This pincode is not serviceable!”)
    }
    },
    error: function(error){
    jQuery(‘#pincode_response’).text(“This pincode is not serviceable!”)
    }
    });
    }
    }

    </script>
    <?php
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.