Community Forums 

Main Content

Shipping API - units value questions

    Oct 08 2008 20:08:52

    #1

    Maida Carpio Scott

    Join date : 2008-09-18      Posts : 24

    I have written my own shipping API in PHP for a client who has items that he ships in their own shipping containers at a set dimension and weight.

    Item 1 ships in a box that weighs 35 lbs
    Item 2 ships in a box that weighs 23 lbs
    item 3 has a flat shipping rate of $4 OR ships for free if you order any number of Item 2 or 3.

    And each item requires its own call to UPS and DHL.

    In order to pass these items to the API using the 'units' value, I have assigned each item 3 unit places

    Item 1 = 1 unit
    Item 2 = 100 units
    Item 3 = 1000 units

    Then using my code, I parse out the units to get the number of each item ordered.

    Now he wants to add 3 more products!

    What's the limit on the units value? I have been assuming it is a float variable. Is it? Can it be an array?

    Any other PHP coders out there have a simpler approach that I might try?

    Thanks,
    Maida