Thank you for your reply,
my scenario is that I have a fix pricing of 0 to 5 kg.
beyond each kilo more I add $ 10.
and since the weights are in grams I would like to convert plus rounding.
now if I will have to follow the example you gave me I will have n rules
Thank you for your help .
Hello, thank you for answering me,
my problem is that my products are in grams, and in the calculation of the shipping costs I use the scenario Gradual increase in shipping based on weight, I would like to apply the rounding function on the weight before calculate the shipping costs
ex: 6.05 kg is 6
6.5 and more kg is 7
I don’t want to have the extra cost of the kilo
I use this function:
add_filter (‘flexible-shipping / condition / contents_weight’,
function ($ weight) {
$ weight = $ weight / 1000;
return (round ($ weight));
});
thank you