---- dataentry snippet ---- type : snippet #do not change this line category : shipping #mention the category like 'shipping', 'checkout' etc name : Dimensional weights #the name of the snippet description : #description about snippet versions_tags : 0.6.0, 0.7.0, 0.7.1, 0.7.2, 1.0 #compatible versions reference_url : http://forum.foxycart.com/comments.php?DiscussionID=1988&page=1 #Item_0 # External link tags_tags : snippets, shipping, advance #tags, separated by commas. date_dt : 2011-05-27 #the date in YYYY-MM-DD format ---- ===== Dimensional weights ===== The context is this: we use USPS priority and express for shipping both domestically and internationally, and in a wide range of object sizes. (Not many different objects, but both tiny and inexpensive and huge and expensive.) For domestic addresses, the priority mail and express mail price estimates are reasonably fair, and scale pretty well. But for international, it can get absurd quickly. A tiny $5 object, priced with regular priority mail to the UK costs $26-- a bit absurd. It would fit in a flat rate for about $13, but since we ship giant things too, we need some way to separate which objects fit into which packages. The method is to add a product option to each small item, which I called "sizecode." An item with sizecode=1 completely fills a USPS flat rate envelope; an item with sizecode=.25 takes up one quarter of a flat rate envelope. We further assume that a USPS priority mail flat rate box can fit four times as much as the envelope. (Note: you can use different assumptions if you like.) The presence of the sizecode option in the cart and checkout page can be hidden through javascript (051 and earlier) or CSS (060+). If any object in the cart does not have the sizecode option specified, the whole game is off-- we assume that it won't fit in a small package. Then, in the FoxyCart admin, we enable USPS domestic priority and express, plus the following five methods: * USPS Express Int'l (package). * USPS Express Int'l flat rate envelope. * USPS Priority Int'l flat rate envelope. * USPS Priority Int'l flat rate box (medium). * USPS Priority Int'l package. The script, added to the checkout template, is as follows: If the package is small enough-- under 1 "flat rate envelopes" worth of volume, then USPS Priority and Express flat rate envelope options are allowed. If it's under 4 "flat rate envelopes" worth of volume, then the USPS priority "medium" flat rate box is shown. And otherwise, it shows the standard priority and express rates. One potential concern is that if you show all five rates allowed for that under-one-envelope package, it's a lot of clutter on the page-- five options to choose from!-- so we actually only show a maximum of three rates at the same time. (Interestingly, in the 1-4 envelope range, Priority International is sometimes cheaper and sometimes more expensive than the Priority International flat rate box.) ===== Related Forum Discussions ===== * http://forum.foxycart.com/comments.php?DiscussionID=1988&page=1#Item_0