PHP Classes

Gnarus Frete: Calculate the package postage cost in Brazil

Recommend this page to a friend!
  Info   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 699 All time: 4,680 This week: 203Up
Version License Categories
gnarusfrete 1.0GNU General Publi...E-Commerce, Web services


This package is specific mainly for applications used in Brazil Brazil .

This class is meant to calculate the postage cost of a deliverying a package in Brazil given the package weight and the postal codes of the origin and destination cities.

It can be used to calculate total shipping costs of deliverying products sold by e-commerce sites.

The postage cost is calculates automatically by the class by accessing the site of the Correios post company or by looking up on CSV files.

The code and the comments are in Portuguese.

In Portuguese:

Esta classe serve para calcular o frete para enviar uma encomenda no Brasil dado o seu peso e o CEP das cidades de origem e destino do envio.

A classe pode ser usada para calcular o custo total do envio de produtos vendidos por sites de comércio eletrônico.

O cálculo do frete pode ser feito automaticamente pela classe acessando o site dos Correios ou usando arquivos locais em formato CSV.

Innovation Award
PHP Programming Innovation award nominee
April 2004
Number 5

Prize: One book of choice by SAMS
Most e-commerce sites that sell physical goods that may be dispatched to many different places, usually have solve the problem of calculating the shipping costs, so the clients may know how much the products will cost before closing a sale.

The problem is that shipping costs may vary according to many factors like the origin and destination of the shipping, weight of the packaged products, size of the packages, etc..

This class provides a solution for calculating the cost of shipping products in Brazil either by using information obtained from locally stored files or connecting to local post office company site.

While this is a country specific solution it may serve as base of inspiration for solutions specific to other countries.

Manuel Lemos
Picture of José Carlos Medeiros
Name: José Carlos Medeiros <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 45
All time rank: 2823200 in Brazil Brazil
Week rank: 703 Up47 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Accessible without login Plain text file cep.csv Data cep´s file
Plain text file class.GnarusFrete.php Class class file
Accessible without login Plain text file frete.csv Data frete price data
Accessible without login Plain text file teste.php Example example

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,680
This week:203Up