More than a year with no response....
Anyone know how to access the total order weight?
I need to export this value to an external shipping application
Do you need the Order Weight:
1 before the order is complete
if so, are you in the checkout when you need this?
or, are you in the shop as the order is being made but not yet in the checkout?
2 after the order is complete
if so, are you in the checkout, such as the checkout_success?
or, are you in the shop, such as the My Account
or, are you in the Admin?
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
No, the checkout process is fine as is.
This is for order fulfillment long after orders are placed. We use the "Export Shipping & Order Information" plugin which outputs order data to a .csv file. The file is then imported into a shipping app that generates labels.
The element missing from the export is the shipping weight for each order.
If I knew where in the database the order total weight was kept (if it is kept), then I can alter the plugin to also output the total order weight for each order.
You need to add a new field, such as:
shipping_weight_total
to the table:
orders
use the sql:
which you can run in the Tools ... Install SQL Patches ...Code:alter table orders add shipping_weight_total decimal(14,5);
or, use phpMyAdmin, as be sure to address the table prefix if you use them ...
Then, you need to save the weight to a session variable, in the shipping class:
Next, you need to customize the order class to add the weight to the table:Code: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; } // bof: save weight for later use $_SESSION['total_order_weight'] = $shipping_weight; // eof: save weight for later use
orders
with:
and that should work with most shipping modules ...Code:'order_total' => $this->info['total'], 'order_tax' => $this->info['tax'], 'currency' => $this->info['currency'], 'currency_value' => $this->info['currency_value'], 'shipping_weight' => $_SESSION['total_order_weight'], 'ip_address' => $_SESSION['customers_ip_address'] . ' - ' . $_SERVER['REMOTE_ADDR'] );
NOTE: be careful of shipping modules where there are other weight calculations in it that may be different than the weight calculation of shipping class and will need to be addressed differently ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
I am loosing it. I have one site where I always see the total weight of an order (in Adming - Customers - Orders) just below the purchased products it shows:
Total Weight is 12 lbs. 0 oz.
Sub-Total: $135.00
Free Shipping Options (Free Shipping): $0.00
Sales Tax: $0.00
Total: $135.00
On all my other up to date 1.5.1 sites it does not show a Total Weight line with Free Shipping Options used. If UPS and USPS shipping options were used to complete the order, shipping weight shows on the order detail in admin. I don't believe I've done any of the above mentioned modifications on this particular site. If, then it was many years ago on an very old Zen version. I've been upgrading this site from 1.3.0 on to today so it is possible that an add on executed some sql in the past that added the needed stuff. How do I go about to have this Total Weight show on my order detail page that I need to process the orders. I need the weight calculation on Free Shipping as well. Not sure why this is not standard anyway. If I need to ship goods, it has a weight even if customer does not pay for it.
Live and learn... the Zen way.
Would the USPS.com Click-n-Ship AutoFill Button module return total weight on the order detail in admin for ALL order no matter if free shipping? Maybe just installing this module could do the trick or one could implement some of the code just for weight display purpose. Just a thought...
I would rather just fix it without needing to install/merge this whole add on.
Live and learn... the Zen way.
Tried this too and I get a "WARNING: An Error occurred, please refresh the page and try again. " at the last step of checkout where the order confirmation should display. If I remove the line "'shipping_weight' => $_SESSION['total_order_weight']," again, then I can checkout. I must say I use COWOA, maybe that makes it fail?
Live and learn... the Zen way.
I notice that my orders table has the field total_weight stored in the 1.3.9a installation where the weight displays correctly. I think this is from the USPS auto fill mod.
How do other store users get to display total weight of an order with free shipping? We all need to ship the products even if we grant free shipping to our customers. I don't understand that this is not a present and ready function of core install. Did I miss something?
Live and learn... the Zen way.
Well, as nobody joins in I keep posting my progress. I have now installed the newest USPS Auto fill 1.6 and this does give me the order total weight even on older existing orders. Kind of overkill as I don't want the USPS autofill anymore on my newest installs. If somebody has another working solutions it would be much appreciated.
Live and learn... the Zen way.
Bookmarks