VbzCart/tables/cat ship cost

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | tables
Revision as of 01:50, 16 July 2009 by Woozle (talk | contribs) (VbzCart/tables/cat ship costs moved to VbzCart/tables/cat ship cost: renaming to singular while it's still easy)
Jump to navigation Jump to search

About

  • Purpose: This table defines the numbers used to calculate shipping costs for different types of items. Eventually it should have fields for tracking weight and co-packaging compatibility so we might have the option of just feeding the estimated shipping weight to shipper APIs and getting back an actual shipping estimate -- but for now, it's based on:
    • $ per package: roughly, the cost of shipping the smallest package which can hold this item, without the actual item. Or, more practically: The cost difference between shipping two of the item and shipping one of the item, subtracted from the cost of shipping one of the item.
    • $ per item: roughly, the cost which the actual item adds to the package. (The rise of shipping cost as weight goes up is approximately linear, but only very approximately.)
  • Fields:
    • CartMsg is a message which should appear near (or in) the shopping cart whenever an item with the corresponding shipping code is ordered. There was also an isApprox field, but the message seems adequate to serve this function. (The flag never did anything beyond displaying a message.)

SQL

<mysql>CREATE TABLE `cat_ship_costs` (

 `ID`      INT NOT NULL AUTO_INCREMENT,
 `Descr`   VARCHAR(63) NOT NULL COMMENT "brief description, for internal use",
 `PerItem` DECIMAL(9,2) COMMENT "s/h cost differential per item",
 `PerPkg`  DECIMAL(9,2) COMMENT "s/h cost for packaging this item",
 `Sort`    FLOAT DEFAULT NULL COMMENT "optional sorting, for internal use",
 `CartMsg` VARCHAR(255) DEFAULT NULL COMMENT "messages regarding shipping for items using this code",
 PRIMARY KEY(`ID`)
);</mysql>