Created
August 31, 2009 20:48
-
-
Save zacharydanger/178701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
product_list = list of selected products and quantities; | |
global_dunnage = percentage defined by admin; | |
fudge_factor = percentage defined by admin; | |
if ( total_cost meets freight override conditions ): | |
return freight calculation; | |
exit; | |
else: | |
for each product in product_list: | |
if( product has dunnage override ): | |
product_weight = weight * product_dunnage * product_quantity; | |
else: | |
product_weight = weight * global_dunnage * product_quantity; | |
calculate recommended boxes; | |
UPS_options = list of options returned from UPS based on recommended boxes and calculated weights; | |
for each option in UPS_options: | |
if( customer has override ): | |
cost = cost - customer_percent; | |
if( zip code has override ): | |
cost = cost - zip_percent; | |
cost = cost * fudge_factor; | |
display UPS shipping options; | |
end-if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment