Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    213
    Plugin Contributions
    0

    Default Tare Weight Calculations

    I am a bit confused and I hope someone can clarify this.
    According to the ZenCart Wiki, the Admin settings for shipping include:
    Enter the Maximum Package Weight you will ship
    (Admin - Catalog)
    Most carriers have a maximum weight limit for a single package. This is a common one for all.
    Default: 50 (assuming pounds)

    Package Tare Small to Medium - added percentage:weight
    (Admin - Catalog)
    Here you define a % of product weight as packaging. This is expressed as two numbers separated by a colon. First number is a % of the weight of that will be your small package weight. Second is your small package weight maximum or upper limit.
    Default: 0:3

    Larger packages - added packaging percentage:weight
    (Admin - Catalog)
    Here you define a % of product weight as packaging. This is expressed as two numbers separated by a colon. First number is a % of the weight of that will be your large package weight. Second is your large package weight average or maximum or upper limit.
    Default: 10:0
    This would imply that the second number is the weight of the package WITH contents, NOT the tare weight of the EMPTY box.
    But the calculations of shipping weight given in includes/classes/shipping.php are:
    Code:
      function calculate_boxes_weight_and_tare() {
        global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;
    
        if (is_array($this->modules)) {
          $shipping_quoted = '';
          $shipping_num_boxes = 1;
          $shipping_weight = $total_weight;
    
          $za_tare_array = split("[:,]" , SHIPPING_BOX_WEIGHT);
          $zc_tare_percent= $za_tare_array[0];
          $zc_tare_weight= $za_tare_array[1];
    
          $za_large_array = split("[:,]" , SHIPPING_BOX_PADDING);
          $zc_large_percent= $za_large_array[0];
          $zc_large_weight= $za_large_array[1];
    
          // SHIPPING_BOX_WEIGHT = tare
          // SHIPPING_BOX_PADDING = Large Box % increase
          // SHIPPING_MAX_WEIGHT = Largest package
    
          /*
          if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
            $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
          } else {
            $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);
          }
          */
    
          switch (true) {
            // large box add padding
            case(SHIPPING_MAX_WEIGHT <= $shipping_weight):
              $shipping_weight = $shipping_weight + ($shipping_weight*($zc_large_percent/100)) + $zc_large_weight;
              break;
            default:
            // add tare weight < large
              $shipping_weight = $shipping_weight + ($shipping_weight*($zc_tare_percent/100)) + $zc_tare_weight;
              break;
    This code implies that the $zc_tare_weight and $zc_large_weight are the weights of the EMPTY boxes as I would expect if I were calculating the TOTAL weight of the box plus contents plus packing material. And the instructions in the Admin>Configuration>Shipping section say that the numbers are:
    (% weight as packaging) : (weight of packaging) which implies that I can state the % weight as packing material and the weight of the empty box as the absolute value. i.e.5% packing material PLUS 0.5 lbs for the box.
    If I assume:
    1. the 2nd explanation is true, and
    2. the "maximum package weight" is the maximum allowed by the shipper, e.g. 70 lbs for USPS, and
    3. the tare weights for small and large boxes are different, then
    how does the calculation know when to use the small box and when to use the large box values?

  2. #2
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default Re: Tare Weight Calculations

    withdrawn
    Last edited by ronlee67; 2 Mar 2008 at 08:56 AM. Reason: conflicting documentation
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

  3. #3
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default Re: Tare Weight Calculations

    You have it right with the second version. It works just like described on the admin-> configuration-> shipping/packaging page.

    • number before the colon sets tare as a percentage of the sum product weights.
    • number after the colon sets tare as an absolute weight

    You can interprete whether the percentage should be packing material, the box or something else.

    You can set tare as strictly a set amount (like 0:1), or as a percentage of sum product weight (2:0) or a combination of both (2:1).

    I believe the Wiki is in error. I find in practice these calculations work as stated on the configuration screen:

    i.e.:
    Package Tare Small to Medium - added percentage:weight

    What is the weight of typical packaging of small to medium packages?
    Example: 10% + 1lb 10:1
    10% + 0lbs 10:0
    0% + 5lbs 0:5
    0% + 0lbs 0:0

    Ron
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

  4. #4
    Join Date
    Sep 2006
    Location
    Colorado Springs CO USA
    Posts
    516
    Plugin Contributions
    2

    Default Re: Tare Weight Calculations

    Quote Originally Posted by mauryg View Post
    how does the calculation know when to use the small box and when to use the large box values?
    http://www.zen-cart.com/forum/showpo...34&postcount=4

    Ron
    www.aspenshopsonline.com - ZenCart 1.3.9h
    www.wilkssupply.com - ZenCart 1.3.9h
    www.un-du.net - ZenCart 1.3.8a

 

 

Similar Threads

  1. v151 Tare Weight / Maximum Package Weight Functionality Change Help
    By jbible in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 17 Jan 2013, 07:17 PM
  2. Tare weight
    By Stella122011 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 13 Apr 2011, 03:08 AM
  3. Tare Weight and Displayed Shipping Weight
    By lynbor in forum Basic Configuration
    Replies: 3
    Last Post: 15 Jul 2010, 01:16 AM
  4. Tare weight settings
    By xscd in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 7 Aug 2008, 01:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg