Sum PHP and higher number

Asked

Viewed 70 times

1

I’m trying to work out a freight system for a company but I’m having a problem. So,:

  • the freight itself is calculated by the Post Office system which access through an API;
  • I have already done everything on the website of the Post Office to carry out consultations for freight calculation;

For the Post API, height, width, weight and product length are required. These values, in turn, are obtained from the customer’s database according to the product to which the freight is to be calculated.

I need the system to get the highest value of length and width and add the height and weight of each produto($id) that they count in the cart. I need this calculation to be done to, for example, place one box on top of the other and not side by side because the smaller boxes will always be placed on top of the larger ones. Avoids harm to customer and supplier.

I can’t think of a way to solve this problem. Any idea?

  • 1

    Do you have any programming problems or specific code that you have difficulty with? If you could translate your text into pseudo-code, it would help...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.