[Since this is a brazilian focused module and it will be used only by brazilians, i will post in portuguese]
Já constatei esse problema tem algum tempo, mas não postei antes porque achei que resolvia sozinho. Só que fui deixando e agora ta em cima da hora hehe.
O módulo não esta calculando direito o peso, fica indicando Peso excedido (erro: -4). Acredito que seja um problema de conversão das unidades de medida, pelo pouco que consegui mexer até agora, parece que ele trata por exemplo 200 gramas como 200 kilogramas pois se colocar o peso como 1 ele faz o calculo como se fosse 1kg.
Estarei trabalhando no código pra ver se encontro o problema e achando eu posto um patch, mas toda ajuda seria bem vinda, vai que é só alguma config que eu errei, pois o meu módulo original de frete não tinha esse problema.
Em anexo duas imagens, uma com peso 1 que "funciona" e outra com peso 200, ambos configurados na página do produto para serem em gramas.
abs
| Comment | File | Size | Author |
|---|---|---|---|
| peso.jpg | 52.53 KB | diegohermes | |
| peso2.jpg | 71.61 KB | diegohermes |
Comments
Comment #1
diegohermes commentedTa loco, foi só criar o tópico que eu achei a solução, era bem simples e não tinha percebido, o erro todo acontece porque o módulo supoem que a unidade de medida padrão configurada da loja é kg, se trocar para grama ou qualquer outra, ele se perde nos calculos.
Bastou alterar para kg novamente que o módulo passa a calcular corretamente. De qualquer jeito, é um bug que seria bom tratar ou ainda mais simples, informar na documentação sobre essa "limitação".
Vou mudar a prioridade, mas manter o tópico ativo, deixo a sua escolha se fecha ele ou não.
abs
Comment #2
agentrickardYes, but posting in Portuguese prevents others from checking for API errors. That's why we use English.
Comment #3
diegohermes commentedYou are right agentrickard, sorry about that.
Anyway, the problem is about the fact that the module consider that the default weight measure is kg, if you switch that to grams for example, the module will do wrong calculations, i realize that after creating this issue, so a immediate solution is use kg as the default weight measure and add this info in the readme file.
Sorry for the bad english, i need to sleep a little.
regards
Comment #4
pasqualleNode 600000. Congratulations!
Comment #5
wasare commenteddiegohermes,
Thanks for this issue report.
I'm planning check the default weight unit and convert it to kg before fetch the shipping quotes.
Comment #6
wasare commentedComment #7
wasare commentedComment #8
lourenzo commentedI have a fix for it working locally, but before commiting, I'd like to as why we're using
instead of the argument passed by ubercart.
In my local debugging, the $products variable seems ok, and contains the
weight_unitskey which enables to calculate and format the weight in the spected unit expected by correios (decimal kilograms).Although, there is a comment in code saying that just using
$productscan cause errors. In which context does it happen?Comment #9
lourenzo commentedJust fixed it in CVS, the question was really simple.
on the line:
The calculation was using the variable
uc_weight_unitas the wanted format, but we want it to be in kilograms.Changing to:
Just solved the problem.
Fixed in cvs.