Freight calculation Post office + PHP

1

How are freight values calculated if a user selects more than one product from a virtual store? At the time of registering a product, we are giving the customer the option to place the length, height, width, diameter and weight per product. In PHP I get this way before I calculate the freight:

$parametros['nVlComprimento'] = '35';
$parametros['nVlAltura'] = '21';
$parametros['nVlLargura'] = '13';
$parametros['nVlDiametro'] = '0';

My only question is how this is calculated? At the moment I'm calculating the amount of products * the freight value that is generated by the API I'm using, but would not I have to also calculate the above values in case the customer chooses another product?

    
asked by anonymous 23.10.2017 / 15:25

1 answer

1

I calculate freight separately for each product. As if I would have one pack for each. Then I add up all the results.

As the freight of the post is based on volume and weight, you can not be sure of the exact value in case of more than one product, since we can not know the size of the final box where everything will be placed all in one box only).

    
23.10.2017 / 17:41