We need a initial implementation of commerce_correios_service_rate_order(). We can base this on UPS module one, and use a cube root for passing dimensions parameters to Correios webservice. Eventually we should integrate with Packaging module for proper calculation of boxes sizes.

Web services client code can be taken from the old plugin file in plugins/quotes/correios/CommerceCorreios.class.php. Some functions need to me moved out of this class to the commerce_correios.module file.

CommentFileSizeAuthor
#2 commerce_correios.tar_.gz6.37 KBpedrorocha

Comments

pedrorocha’s picture

Assigned: Unassigned » pedrorocha

I'm on it!

pedrorocha’s picture

Status: Active » Patch (to be ported)
StatusFileSize
new6.37 KB

[pt-br]

Aqui está o módulo completo, já que eu inclui uma imagem, removi arquivos, pastas, etc, então não daria para fazer somente 1 arquivo de patch.

Essa é a conversão do módulo para se adequar ao API 2.x do módulo Shipping, então ainda não contêm a integração com o Physical Fields, que é um próximo passo a dar.

Os serviços oferecidos pelo Correio não estão todos habilitados(comentei no código) porque a maioria se refere a modalidades para quando o remetente tem contrato direto com os Correios, o que não está sendo considerado pelo módulo ainda, já que a opção que indica os dados da empresa estão sendo passadas em branco manualmente, precisando criar uma forma de configurar isso na tela para o módulo passar a suportar essas outras modalidades.

recidive’s picture

Status: Patch (to be ported) » Needs work

Thanks @pedrorocha!

I did some changes to the code in #2 and committed it to 2.x branch. I removed the class and added standard functions. Also aggregated the calculation functions in only one and added back the entity wrapper, since this is a good practice for getting fields values.

I removed the functions with error messages as they are already returned by the webservice when some error occur, thus there's no need to map that.

I also removed the image as it's not needed, and moved the help in the settings form to field descriptions.

Needs testing to check if I haven't broken anything.

Moving issue to "needs work" until we get some of the Physical Fields integration done.

recidive’s picture

Status: Needs work » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.