News:

Looking for documentation? Take a look on our wiki

Main Menu

Show order weight in invoice

Started by Adam Bazaroff, October 13, 2016, 21:58:04 PM

Previous topic - Next topic

Adam Bazaroff

How can I show order_weight in invoice?
Thanks!
/Adam'B ... Poor english mode [ON] ;D

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Adam Bazaroff

Sorry, VirtueMart 2.6.14... but v.3 is don't have this too.
/Adam'B ... Poor english mode [ON] ;D

Milbo

You should update at least to vm2.6.22. This should work without any trouble. The update to vm3 is also not a big deal as long you stay with joomla 2.5
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Adam Bazaroff

Thank you, but right now I try to find solution for showing order weight on Invoice.
/Adam'B ... Poor english mode [ON] ;D

Milbo

There is as far as I know, no native method in vm2
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Adam Bazaroff

But it shows in order edit, on the bottom of page! In delivery table. How I can show it in invoice?
/Adam'B ... Poor english mode [ON] ;D

Milbo

That is part of your delivery table and depends on your shipment plugin.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Marttyn

Im developing a plugin to generate a file with the order shipping details. So then i can use this file to upload it on the shipping company website, and avoid copying manually all the shipping details.
I need to specify the order weight, but i cant find it in getMyOrderDetails(). Instead there i could find each product weight alone. So i go through all the items in the order adding each product weight. Is this the best approach to do it?


$orderDetails = $orderModel->getMyOrderDetails($id);

foreach($orderDetails['items'] as $item){
if(!empty($item->product_weight)){
$qty = (int)$item->product_quantity;
$weight = (int)$item->product_weight;

//weight in grams
if($item->product_weight_uom == "G"){
$total_weight = $total_weight + ($weight * $qty);
}
//weight in kilos
elseif($item->product_weight_uom == "Kg"){
$total_weight = $total_weight + (($weight * 1000) * $qty);
}
}
}


Thanks

pinochico

There is no weight for packaging, You have to add to function
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

AH

Martyn

Yes - there is no weight stored in the order item table or the total order header

Therefore you have to get the current item weight and do the calculation yourself when an order is loaded
Regards
A

Joomla 3.10.11
php 8.0

Marttyn

As showed before, ive already done the coding, and its working fine.
But woudnt it be grate if VM already had a function to retrieve the order weight?

pinochico

QuoteBut woudnt it be grate if VM already had a function to retrieve the order weight?

ok, - again :)

You don't have setup for weight of packaging for order. This weight I have to send to shipping company and show in cart nad order summary, because sometime order has another price for shipping, then we added custom code for shipping plugin and change calculation in cart.


Rudolf
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products