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. product detail not display on maxican paypal payment page
    By dilipvaghasiya in forum PayPal Express Checkout support
    Replies: 13
    Last Post: 13 Aug 2010, 12:43 PM
  2. Product Detail Page Display Issue
    By CompuWeb in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 1 Jul 2010, 03:45 PM
  3. Need to display manufacturer name in product detail page
    By tabor.carlton in forum General Questions
    Replies: 4
    Last Post: 18 Sep 2009, 02:59 AM
  4. Zone Shipping Cost based on Individual item weight, not total order weight
    By pohnean in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 16 Sep 2009, 09:02 AM
  5. 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

Bookmarks

Posting Permissions

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