Create Delivery Time by ZIP Group

Asked

Viewed 49 times

-2

I have a form that calculates the cost of delivery per ZIP CODE group, what I need now is for each group to add a delivery time. Example: The ZIP Code group that charges R $ 4,30 will have the delivery time in 50 minutes, already the ZIP Code group that charges R $ 6,50 will have the delivery time in 120 minutes...

Follow the code of the form.js file where you have this calculation:

var str = "";
var id = "";
var sub = 0.00;
var taxa = 0;
var taxadeentrega = total - taxa;
var total = 0.00;
var qcount = 0;
var scount = 0;
var opc = 0;
var options = "";
for (i=1; i<21; i++){
    options += "<option value='" + i + "'>" + i + "</option>";
}

$( document ).ready(function() {

    $( "div div select" ).html(options); 
    $( "div div :text" ).attr("value","1");
    $( "#emporio" ).css("display","block");
    $( "#mudaopcao" ).click(function() {
      location.reload(true);
    });
    function alerta(txt){
        $( "div#alerta" ).html( txt ).show( 0 ).delay( 2500 ).fadeOut( 500 );
    }
function atencao(txt){
        $( "div#atencao" ).html( txt ).show( 0 ).delay( 2500 ).fadeOut( 500 );
    }
    function mens(){
        var d = new Date();
        var n = d.getDate() + "|" + (d.getMonth()+1) + "|" + d.getFullYear() + " - " + d.getHours() + ":" + d.getMinutes();

        $( "div#quentes :checkbox:checked" ).each(function() {
              str = str + $(this).parent().children("strong").text();
              if (opc == 4){
                  var sel = $(this).parent().children("span").children("select").val();
                  str = str + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",");
              }
              str = str + "<br>";
        })
        $('input[name=quentes]').val(str);
        str = "";



        $( "div#embalagem :checkbox:checked" ).each(function() {
              var sel = $(this).parent().children("select").val();
              str = str + $(this).parent().children("strong").text() + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",") + "<br>";
        })
        $('input[name=embalagem]').val(str);
        str = "";



        $( "div#molhos :checkbox:checked" ).each(function() {
              str = str + $(this).parent().children("strong").text();
              if (opc == 4){
                  var sel = $(this).parent().children("span").children("select").val();
                  str = str + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",");
              }
              str = str + "<br>";
        })
        $('input[name=molhos]').val(str);
        str = "";



        $( "div#saladas :checkbox:checked" ).each(function() {
              str = str + $(this).parent().children("strong").text();
              if (opc == 4){
                  var sel = $(this).parent().children("span").children("select").val();
                  str = str + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",");
              }
              str = str + "<br>";
        })
        $('input[name=saladas]').val(str);
        str = "";

        $( "div#sobremesas :checkbox:checked" ).each(function() {
              var sel = $(this).parent().children("select").val();
              str = str + $(this).parent().children("strong").text() + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",") + "<br>";
        })
        $('input[name=sobremesas]').val(str);
        str = "";

        $( "div#sucos :checkbox:checked" ).each(function() {
              var sel = $(this).parent().children("select").val();
              var val = $(this).parent().children("input:radio:checked").val();
              str = str + $(this).parent().children("strong").text() + " - " + $(this).parent().children("input:radio:checked").attr("l") + ": R$ " + val.replace(".", ",") + " x " + sel + " = R$ " + (val * sel).toFixed(2).replace(".", ",") + "<br>";
        })
        $('input[name=sucos]').val(str);
        str = "";

        $( "div#bebidas :checkbox:checked" ).each(function() {
              var sel = $(this).parent().children("select").val();
              str = str + $(this).parent().children("strong").text() + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",") + "<br>";
        })
        $('input[name=bebidas]').val(str);
        str = "";

        $( "div#sopas :checkbox:checked" ).each(function() {
              var sel = $(this).parent().children("select").val();
              str = str + $(this).parent().children("strong").text() + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",") + "<br>";
        })
        $('input[name=sopas]').val(str);
        str = "";

        $( "div#emporio :checkbox:checked" ).each(function() {
              var sel = $(this).parent().children("select").val();
              str = str + $(this).parent().children("strong").text() + ": R$ " + $(this).val().replace(".", ",") + " x " + sel + " = R$ " + (($(this).val() * sel).toFixed(2)).replace(".", ",") + "<br>";
        })
        $('input[name=emporio]').val(str);
        str = "";

        str = String(total.toFixed(2)).replace(".", ",");
        $('input[name=mtotal]').val(str);
        str = "";

        str = String(+ taxa.toFixed(2)).replace(".", ",");
        $('input[name=taxadeentrega]').val(str);
        str = "";


        if(opc==1){
            $('input[name=op]').val("3 Quentes e 3 Saladas");
        }else if(opc==2){
            $('input[name=op]').val("4 Quentes e 4 Saladas");
        }else if(opc==3){
            $('input[name=op]').val("5 Quentes e 5 Saladas");
        }else{
            $('input[name=op]').val("");
        }

        if(opc==0){
            $('input[name=nop]').val("");       
        } else {
            str = "<strong>Opção " + opc + ": </strong>";
            $('input[name=nop]').val(str);
            str = "";
        }

        $('input[name=data]').val(n);
    }

      $("div#quentes :checkbox").click(function(){
          if($(this).prop("checked") == true){
              qcount++;
              if (opc == 1){
                  if (qcount == 4){
                      $( this ).prop( "checked", false );
                      atencao("Você só pode escolher 3 pratos quentes, para mais escolha outra opção");
                      qcount = 3;
                  }
                  if (qcount == 1){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 2 pratos quentes");

                  }
                  if (qcount == 2){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 1 prato quente");

                  }
              } else if (opc == 2){
                  if (qcount == 5){
                      $( this ).prop( "checked", false );
                      atencao("Você só pode escolher 4 pratos quentes, para mais escolha outra opção");
                      qcount = 4;
                  }
                   if (qcount == 1){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 3 pratos quentes");

                  }
                  if (qcount == 2){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 2 pratos quentes");

                  }
                   if (qcount == 3){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 1 prato quente");

                  }
              } else if (opc == 3){
                  if (qcount == 6){
                      $( this ).prop( "checked", false );
                      atencao("Você só pode escolher 5 pratos quentes, para mais escolha outra opção");
                      qcount = 5;
                  }
                    if (qcount == 1){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 4 pratos quentes");

                  }
                  if (qcount == 2){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 3 pratos quentes");

                  }
                   if (qcount == 3){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 2 pratos quentes");

                  }
                   if (qcount == 4){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 1 prato quente");

                  }
              }
          } else if($(this).prop("checked") == false){
              qcount--;
          }
      }) 





      $("div#saladas :checkbox").click(function(){
          if($(this).prop("checked") == true){
              scount++;
              if (opc == 1){
                  if (scount == 4){
                      $( this ).prop( "checked", false );
                      atencao("Você só pode escolher 3 saladas, para mais escolha outra opção");
                      scount = 3;
                  }
                  if (scount == 1){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 2 saladas");
                  }
                  if (scount == 2){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 1 salada");
                  }

              } else if (opc == 2){
                  if (scount == 5){
                      $( this ).prop( "checked", false );
                      atencao("Você só pode escolher 4 saladas, para mais escolha outra opção");
                      scount = 4;
                  }
                   if (scount == 1){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 3 saladas");
                  }
                  if (scount == 2){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 2 saladas");
                  }
                  if (scount == 3){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 1 salada");
                  }

              } else if (opc == 3){
                  if (scount == 6){
                      $( this ).prop( "checked", false );
                      atencao("Você só pode escolher 5 saladas, para mais escolha outra opção");
                      scount = 5;
                  }
                  if (scount == 1){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 4 saladas");
                  }
                  if (scount == 2){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 3 saladas");
                  }
                  if (scount == 3){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 2 saladas");
                  }
                  if (scount == 4){
                      $( this ).prop( "checked", true );
                      alerta("Você ainda pode escolher 1 salada");
                  }
              }
          } else if($(this).prop("checked") == false){
              scount--;
          }
      })

      $( ":input" ).click(function() {
      total = 0;
      sub = 0;

      if ($( "div#opcoes input:radio:checked" ).length > 0) {
        $( "#mudaopcao, #titulo2, div#quentes :checkbox, div#saladas :checkbox" ).css("display","inline-block");
        sub += $( "div#opcoes input:radio:checked" ).val() * 1;
        if ($( "div#opcoes input:radio:checked" ).attr("op") == 1){
            opc = 1;
            $( "#op2,#op3,#op4,div#quentes span" ).css("display","none");
        } else if ($( "div#opcoes input:radio:checked" ).attr("op") == 2){
            opc = 2;
            $( "#op1,#op3,#op4,div#quentes span" ).css("display","none");
        } else if ($( "div#opcoes input:radio:checked" ).attr("op") == 3){
            opc = 3;
            $( "#op1,#op2,#op4,div#quentes span" ).css("display","none");
        } else if ($( "div#opcoes input:radio:checked" ).attr("op") == 4){
            opc = 4;
            $( "#op1,#op2,#op3,div#quentes span" ).css("display","none");
            $("div#quentes span, div#saladas span").css("display","inline-block");

            $( "div#quentes :checkbox:checked" ).each(function() {
                sub += $( this ).val() * $( this ).parent().find("select").val();
            }) //each quentes


            $( "div#saladas :checkbox:checked" ).each(function() {
                sub += $( this ).val() * $( this ).parent().find("select").val();
            }) //each saladas
        }
      }


        $( "div#embalagem :checkbox:checked" ).each(function() {
            sub += $( this ).val() * $( this ).parent().children( "select" ).val();
        }) //each embalagem



       $( "div#molhos :checkbox:checked" ).each(function(i) {
        if (i > 0) {
          sub += $( this ).val() * 1;
        }
    }); // each molhos


        $( "div#sobremesas :checkbox:checked" ).each(function() {
            sub += $( this ).val() * $( this ).parent().children( "select" ).val();
        }) //each sobremesas


        $( "div#sucos :checkbox:checked" ).each(function() {
            sub += $( this ).parent().children( ":radio:checked" ).val() * $( this ).parent().children( "select" ).val();
        }) //each sucos


        $( "div#bebidas :checkbox:checked" ).each(function() {
            sub += $( this ).val() * $( this ).parent().children( "select" ).val();
        }) //each bebidas

        $( "div#sopas :checkbox:checked" ).each(function() {
            sub += $( this ).val() * $( this ).parent().children( "select" ).val();
        }) //each sopas

        $( "div#emporio :checkbox:checked" ).each(function() {
            sub += $( this ).val() * $( this ).parent().children( "select" ).val();
        }) //each emporio

        total += sub;


        //aqui eu pego o cep
var cep = document.getElementById("cep").value;

//verifica se deve incrementar ou não
if(cep == "20040-010" || cep == "22750-009" || cep == "20071-002" || cep == "20090-910" || cep == "20210-010" || cep == "20080-102" || cep == "20230-130" || cep == "20081-250" || cep == "20090-030" || cep == "20090-030" || cep == "20211-340" || cep == "20211-351" || cep == "20221-240" || cep == "20221-250" || cep == "20230-010" || cep == "20230-011" || cep == "20230-025" || cep == "20230-150" || cep == "20230-160" || cep == "20230-240" || cep == "20231-016" || cep == "20231-030" || cep == "20231-031" || cep == "20231-050" || cep == "20211-005" || cep == "20231-085" || cep == "20230-014" || cep == "20231-004" || cep == "20021-180" || cep == "20240-180" || cep == "20240-051" || cep == "20211-010" || cep == "20230-170" || cep == "20230-024" || cep == "20240-050" || cep == "20230-050" || cep == "20231-006" || cep == "20090-010" || cep == "20230-901" || cep == "20040-051" || cep == "20241-080" || cep == "20221-901" || cep == "20051-011" || cep == "20021-190" || cep == "20240-200" || cep == "20230-170" || cep == "20231-015" || cep == "20211-350" || cep == "20231-020" || cep == "20061-030" || cep == "20050-092" || cep == "20240-050" || cep == "20230-070" || cep == "20230-015" || cep == "20021-350" || cep == "20230-070"){

        //se for um dos ceps acima, incrementa 4 no valor final
    taxa = 4.30;


        //verifica se deve incrementar ou não
}if(cep == "22221-010" || cep == "22221-011" || cep == "22210-906" || cep == "22250-060" || cep == "22250-020" || cep == "22250-902" || cep == "22250-903" || cep == "22250-030" || cep == "22230-020" || cep == "22210-030" || cep == "22210-065" || cep == "22210-901" || cep == "22210-903" || cep == "22210-904" || cep == "22210-902" || cep == "22210-060" || cep == "22210-905" || cep == "22250-110" || cep == "22220-080" || cep == "22220-900" || cep == "22230-075" || cep == "22220-030" || cep == "22231-140" || cep == "22210-050" || cep == "22230-010" || cep == "22250-130" || cep == "22220-050" || cep == "22220-040" || cep == "22230-040" || cep == "22210-040" || cep == "22250-100" || cep == "22250-120" || cep == "22220-060" || cep == "22230-060" || cep == "22230-061" || cep == "22230-902" || cep == "22230-903" || cep == "22230-901" || cep == "22230-030" || cep == "22231-150" || cep == "22210-085" || cep == "22210-080" || cep == "22230-080" || cep == "22250-090" || cep == "22250-070" || cep == "22231-130" || cep == "22250-080" || cep == "22230-000" || cep == "22230-001" || cep == "22230-900" || cep == "22221-000" || cep == "22210-070" || cep == "22230-070" || cep == "22230-050" || cep == "22231-230" || cep == "22240-180" || cep == "22240-090" || cep == "22240-120" || cep == "22240-030" || cep == "22231-210" || cep == "22245-130" || cep == "22240-160" || cep == "22231-170" || cep == "22231-900" || cep == "22240-130" || cep == "22241-020" || cep == "22240-080" || cep == "22240-170" || cep == "22231-220" || cep == "22245-020" || cep == "22245-070" || cep == "22221-110" || cep == "22245-000" || cep == "22231-110" || cep == "22245-030" || cep == "22245-060" || cep == "22240-000" || cep == "22240-003" || cep == "22240-004" || cep == "22240-006" || cep == "22240-005" || cep == "22240-900" || cep == "22221-120" || cep == "22221-130" || cep == "22240-040" || cep == "22231-160" || cep == "22240-020" || cep == "22221-070" || cep == "22245-110" || cep == "22245-120" || cep == "22221-100" || cep == "22231-120" || cep == "22245-140" || cep == "22240-100" || cep == "22231-070" || cep == "22245-050" || cep == "22241-000" || cep == "22241-970" || cep == "22231-100" || cep == "22221-080" || cep == "22231-200" || cep == "22245-010" || cep == "22221-090" || cep == "22221-140" || cep == "22231-090" || cep == "22231-901" || cep == "22240-150" || cep == "22231-080" || cep == "22245-150" || cep == "22245-040" || cep == "22245-100" || cep == "22240-060" || cep == "22240-140" || cep == "22241-010" || cep == "22240-110" || cep == "22231-180" || cep == "22240-070" || cep == "22245-080" || cep == "22245-090" || cep == "22221-150" || cep == "22240-010" || cep == "20211-110" || cep == "22220-020" || cep == "22231-190"){

        //se for um dos ceps acima, incrementa 5.5 no valor final
    taxa = 6.50;


    //verifica se deve incrementar ou não
}if(cep == "20241-220" || cep == "22210-015" || cep == "22220-000" || cep == "20241-160" || cep == "20021-040" || cep == "20241-150" || cep == "22210-010" || cep == "22211-230" || cep == "22220-000" || cep == "22220-070" || cep == "22221-060" || cep == "22211-200" || cep == "22221-020" || cep == "20241-180" || cep == "20240-200"){

        //se for um dos ceps acima, incrementa 5.5 no valor final
    taxa = 6.0;


}if(cep == "20050-091" || cep == "20060-050" || cep == "20071-000" || cep == "20080-003" || cep == "20081-000" || cep == "20081-050" || cep == "20090-000" || cep == "20090-003" || cep == "20231-092" || cep == "24938-600" || cep == "20051-002" || cep == "20090-050" || cep == "20231-046" || cep == "20231-047" || cep == "20231-048" || cep == "20060-070" || cep == "20231-094" || cep == "20090-001" || cep == "20231-093" || cep == "20051-011" || cep == "20060-010" || cep == "20050-002"){

    //se for um dos ceps acima, incrementa 3.5 no valor final
    taxa = 3.8;


    }if(cep == "20090-003" || cep == "20071-001" || cep == "20221-901"){

    //se for um dos ceps acima, incrementa 4.8 no valor final
    taxa = 4.8;


}if(cep == "20031-170" || cep == "20040-004" || cep == "20040-902" | cep == "20021-360" || cep == "20040-020" || cep == "20040-908" || cep == "20071-000" || cep == "20230-070" || cep == "20071-004" || cep == "20040-009" || cep == "20230-060"){

    //se for um dos ceps acima, incrementa 3 no valor final
    taxa = 3.30;

}if(cep == "20010-010" || cep == "20020-906" || cep == "20031-908" || cep == "20031-917" || cep == "20040-001" || cep == "20040-006" || cep == "20050-090" || cep == "20070-022" || cep == "20031-909" || cep == "20031-904" || cep == "20021-390" || cep == "20031-919" || cep == "20031-912" || cep == "20031-905" || cep == "20050-060" || cep == "20031-901" || cep == "20070-021" || cep == "20031-924" || cep == "20051-040" || cep == "20031-901" || cep == "20003-191" || cep == "20241-110" || cep == "20031-900" || cep == "20050-030"){

    //se for um dos ceps acima, incrementa 2.5 no valor final
    taxa = 2.80;


}if(cep == "20010-020" || cep == "20011-020" || cep == "20011-030" || cep == "20011-040" || cep == "20011-901" || cep == "20020-000" || cep == "20010-170" || cep == "20011-000" || cep == "20021-260" || cep == "20031-040" || cep == "20031-050" || cep == "20031-130" || cep == "20031-204" || cep == "20021-245" || cep == "20040-002" || cep == "21335-253" || cep == "20040-031" || cep == "20030-041" || cep == "20040-000" || cep == "20004-002" || cep == "20040-003" || cep == "20040-007" || cep == "20030-042" || cep == "20011-010"){

    //se for um dos ceps acima, incrementa 1.7 no valor final
    taxa = 2.00;


}if(cep == "20010-090" || cep == "20020-100" || cep == "20021-130" || cep == "20021-315" || cep == "20030-001" || cep == "20031-000" || cep == "20031-003" || cep == "20031-010" || cep == "20031-050" || cep == "20031-141" || cep == "20031-143" || cep == "20031-005" || cep == "20031-001" || cep == "20020-903" || cep == "20031-144" || cep == "20030-080" || cep == "20031-142" || cep == "20031-120" || cep == "20031-007" || cep == "20010-009" || cep == "20031-913" || cep == "20021-370" || cep == "20200-100" || cep == "20030-901" || cep == "20030-021" || cep == "20210-030" || cep == "24220-280"){

    //se for um dos ceps acima, incrementa 1.2 no valor final
    taxa = 1.50;


}if(cep == "20020-010"|| cep == "22050-032" || cep == "20020-040" || cep == "20020-080" || cep == "20021-060" || cep == "20021-120" || cep == "20021-900" || cep == "20021-903" || cep == "20030-002" || cep == "20030-015" || cep == "20030-013" || cep == "20030-020" || cep == "20030-021" || cep == "20030-060" || cep == "20030-070" || cep == "20030-120" || cep == "20002-080" || cep == "20002-008" || cep == "20003-021" || cep == "20030-905" || cep == "24220-031" || cep == "20002-010" || cep == "20030-015"){

    //se for um dos ceps acima, incrementa 0.7 no valor final
    taxa = 1.00; 

}

total += taxa;      

if(taxa != 0){

//caso a taxa seja diferente de 0, mostra ao usuário
    document.getElementById("idTaxa").innerHTML = "Custo adicional: R$ " + taxa;
}

        $( "div#total" ).html( "Valor total da sua<br>encomenda: R$ " + String(total.toFixed(2)).replace(".", ",") );
        $( "div#total" ).css("display", "block");
        $( "#total2" ).html( "R$ " + String(total.toFixed(2)).replace(".", ",") );      
      }) //click
      $( "#total2" ).html( "R$ " + String(total.toFixed(2)).replace(".", ",") );      


      $( "form" ).submit(function( event ) {
         if (opc == 4 && (qcount + scount)<6){
            event.preventDefault();
            alerta("Você deve escolher, no mínimo, 6 itens, entre os pratos quentes e saladas");
            return false;
        } else if (total < 22.90){
            event.preventDefault();
            alerta("O valor mínimo do pedido é R$ 22,90");
            return false;
        } else if ($("#nome").val()=="" || $("#endereco").val()=="" || $("#email").val()=="" || $("#cep").val()=="" || $("#telefone").val()==""){
            event.preventDefault();
            alerta("Todos os campos de informação são obrigatórios");
            return false;
        }
        mens();
      }); //form

}); // doc ready

Follow the form link:

Online form

1 answer

0

I suggest you use a different approach to your solution. We can use a map with all these ceps and the values you will need to extract. This will avoid excess of if in your code and facilitate future changes.

IMPORTANT: In the codes below, remember that the use of ellipsis (...) is only to shorten. Replace with the rest of the required ceps.

Example:

var cepMap = {
    "group1": {
        "ceps": ["20040-010", "22750-009", "20071-002", ...],
        "taxa": 4.30,
        "tempoEntrega": 50
    },
    "group2": {
        "ceps": ["20241-220", "22210-015", "22220-000", ...],
        "taxa": 6.00,
        "tempoEntrega": 120
    },
    ...
};

This way, you can create a function that returns exactly what you want based on the cep, for example. See:

function retornaValor(cep, valorEsperado) {
    for (var i in cepMap){
        var group = cepMap[i],
            ceps = group.ceps;

        if (ceps.indexOf(cep) > -1) {
             return group[valorEsperado];
        };
    };
};

And to execute:

var taxa = retornaValor("20040-010", "taxa"); // taxa será igual 4.3
var tempo = retornaValor("20241-220", "tempoEntrega"); // tempo será igual 120
  • Thank you Brunno Vianna! I am layman, I do not know how to put these last codes. I understood your dynamic, but I don’t know how to put it in my current code. Can you help me? I put a link from the form in the post. The only difference from this form to the real one is that it does not receive the ZIP code information (this is loaded when the user logs in the form), but note that down there is the field that loads the Total information of your order and Delivery Fee. The Delivery Time I just created for when the system works, it shows in this field this information.

  • Right after the function I created (following the form in the Fiddler you posted): rate = returnValue(cep, "taxadedelivery"); total += rate; .

  • And then you can do the same for any other value you want to add in the application. Just insert one more property into the cepMap object and call the function returns Value, passing the cep as the first argument and the property name as the second.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.