VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: m.davide82 on July 14, 2020, 16:54:00 PM

Title: How can I get the order weight?
Post by: m.davide82 on July 14, 2020, 16:54:00 PM
Hi,

How can I get the order weight?
Which is the right php variable?
Vm 3.6 - php 7.3



Thanks a lot.
Davide
Title: Re: How can I get the order weight?
Post by: AH on July 14, 2020, 16:56:16 PM
when
Title: Re: How can I get the order weight?
Post by: m.davide82 on July 14, 2020, 17:40:04 PM
In the invoice/order confirmation, for example.
Title: Re: How can I get the order weight?
Post by: AH on July 14, 2020, 19:13:58 PM
It really depends on what you want to do

From what I can see - if you are aiming to add this information to the templates for display/print, you may find that you will have to calculate it from the order_items data.

The shipping plugin does store order_weight that was used at the time shipping was calculated - you could get that data from the table - but it may not reflect the current state of the order.
Title: Re: How can I get the order weight?
Post by: m.davide82 on July 17, 2020, 12:47:00 PM
Hi,

I've seen the ther order_weight is stored in the shipping orders table.
I would like to have that value in a variable!  :)


Thanks.

Davide
Title: Re: How can I get the order weight?
Post by: AH on July 17, 2020, 12:51:35 PM
Well you will have to create it then :-)

Just use the order details to get the shipping table entry and get it from there
Title: Re: How can I get the order weight?
Post by: m.davide82 on July 27, 2020, 11:46:13 AM
Ehm... thanks!  :)


Any help?  :)
Title: Re: How can I get the order weight?
Post by: pinochico on July 27, 2020, 17:09:39 PM
QuoteAny help?

Any help for what?

The post from AH is finally help.
You must develop self, why are you don't understand?

Maybe you are waiting for code :D
Title: Re: How can I get the order weight?
Post by: AH on July 29, 2020, 19:22:05 PM
I will not be posting code - it is easy for a coder to do in php as a template override if necessary