Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

calculate the freight to send for our customer


loucospormusica

Recommended Posts

Posted

Here in Brazil people use cep to calculate the freight to send for our customer. My doubt is that I obtained a data base to calculate, has a store that it uses this system, as I can integrates it in my store?

 

http://www.e-armazem.com.br/loja/shopping_cart.php

 

 

script language="JavaScript">
function formataCEP (keypress, objeto)
{
campo = eval (objeto);
caracteres = '0123456789';
if (String.fromCharCode (keypress) == '.')
	event.returnValue = false;

if ((caracteres.search(String.fromCharCode (keypress))!=-1) && campo.value.length <= 9)
{
	if (campo.value.length == 5) 
   		campo.value = campo.value + '-';
}
else if (keypress != 13)
	event.returnValue = false;
}

function formataCEP_Special_Key (keypress, objeto)
{
if (keypress == 8) {// backspace
	if (campo.value.length == 7) 
		  campo.value= campo.value.substr(0,6);
}
else if (keypress == 46) {// DEL
	campo.value=campo.value.substr(0, campo.value.length-1);
	if (campo.value.length == 6) 
		  campo.value= campo.value.substr(0,5);
}
}

function validate_cep()
{
if (document.calcula_frete.elements["cart_CEP"].value.length != 9) {
	alert("CEP Inv?lido");
	document.calcula_frete.elements["cart_CEP"].focus();
	return false;
}
else 
	return true;
}

function AutoPAC() {document.calcula_frete.submit(); };
function AutoBRASPRESS() {document.calcula_frete.submit(); };
function AutoENCOMENDA_NORMAL() {document.calcula_frete.submit(); };
function AutoGRATIS() {document.calcula_frete.submit(); };
function AutoSEDEX() {document.calcula_frete.submit(); };


</script>

 

Thanks

http://www.loucospormusica.com

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...