Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2010
    Posts
    8
    Plugin Contributions
    0

    Default How to display shipping weight in admin order detail page?

    Hello,

    I am running 1.3.8a patched and am trying to find a way to display the shipping weight for an order in the details page in admin

    Unless I know the weight of the items I have to re-create the users shopping cart so I can figure out what shipping weight to enter to my shipping carrier, surprisingly this basic information isn't available in the admin

    I added a 'shipping_total_weight" field to the orders table as per http://www.zen-cart.com/forum/showthread.php?t=92657 but am unable to get it to show the value in admin/orders.php. I confirmed when new orders are created that the field is correctly propogated with the weight

    Now my PHP knowledge is limited and I have seen this question raised a few times with no answers in my searches, does anyone have a solution?

    Thank you!

  2. #2
    Join Date
    Apr 2010
    Posts
    8
    Plugin Contributions
    0

    Default Re: How to display shipping weight in admin order detail page?

    Figured it out here it is for anyone else looking to do something similar:

    First two steps from http://www.zen-cart.com/forum/showthread.php?t=92657:

    1. ...to add the total shipping weight (without the tare corrections, i.e. small to medium package 10:1) to the import you will need to run this command from either the mysql command line or the sql patches:

    **** NOTE ****
    BE SURE TO CHANGE "prefix" IN THE FOLLOWING COMMAND TO WHATEVER YOUR TABLE PREFIX IS
    *************

    Code:
    alter table prefix_orders add shipping_weight_total decimal(14,5);
    (in my case I did not enter a prefix with the underscore as it automatically added it for me in sql patches)

    2. Then edit your /includes/classes/order.php on line 613 where it reads:

    Code:
    'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR']
    );
    replace with:

    Code:
    'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'],
    'shipping_weight_total' => $_SESSION['cart']->weight
    );
    3. Finally around line 323 in admin/orders.php find:

    Code:
                  <tr>
                    <td class="main"><strong><?php echo TEXT_INFO_IP_ADDRESS; ?></strong></td>
                    <td class="main"><?php echo $order->info['ip_address']; ?></td>
                  </tr>
    and replace with:
    Code:
                  <tr>
                    <td class="main"><strong><?php echo TEXT_INFO_IP_ADDRESS; ?></strong></td>
                    <td class="main"><?php echo $order->info['ip_address']; ?></td>
                  </tr>
    <?php
    
            $ship_wght = $db->Execute("select shipping_weight_total from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
    
    ?>
                  <tr>
                    <td class="main"><br /><strong>Shipping Weight:</strong></td>
                    <td class="main"><br /><?php echo round($ship_wght->fields['shipping_weight_total'], 2); ?> lbs</td>
                  </tr>
    I rounded to two decimal points you could do that or probably change 5 in 14,5 to the number of decimal points.

    New orders will list the shipment weight on the admin order details page - you could put this in other places but the location suits me

    Probably better ways of doing it but in the absence of this feature it works great for me now

 

 

Similar Threads

  1. free shipping - how to determine order weight
    By rmoore in forum General Questions
    Replies: 0
    Last Post: 5 May 2010, 09:00 PM
  2. How to display lightbox directly from Product listing? (no product detail page)
    By y2caye in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Jan 2010, 03:38 AM
  3. Can I display estimate shipping costs in product detail page?
    By zhshji in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 8 Apr 2009, 03:39 PM
  4. Replies: 4
    Last Post: 3 Aug 2006, 11:37 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