Details: Working for a company that sells candles in packages of 1,2,3,4,5 and 6.
Their website is set, and their database is adequate.
Situation: I need to be able to breakdown large orders for efficient packaging. So, if a customer orders twelve candles, I could transpose the order into 2 six-packs. If the order were for sixteen candles, the order would transpose to 2 six-packs and 1 four-pack. Always using the largest sized sets possible.
Do NOT want an order for 12 being assembled as 3 fours or 4 threes, as it is inefficient.
Can the quantity be INSERTED into the table accordingly, or does it need to be inserted as 16 (for example) and then broken down afterward??
I am not sure whether I can do this in PHP or if a JavaScript is better.
Obviously, i need to divide the largest orders by six, but not sure how to get that number, and how to incorporate the remainder.
Please help.
i used to have a stress ball.... ya know, those rubbery things for you to squeeze and throw to AVOID real damage, but I broke it!