VirtueMart Forum

VirtueMart 2 + 3 => 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
Quote
Any 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