Active
Project:
Commerce Physical Product
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2012 at 18:06 UTC
Updated:
11 Sep 2020 at 04:43 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
gundara commented+1
Comment #2
ioanmar commented+1
Comment #3
kevster commentedThis would be a great feature as although we have weight on each product line item we cant see a way to add the total weight order, +1...
Comment #4
blueblade commented+1
Comment #5
ecvandenberg commentedI think this request is still valid. How can I help to get this going?
Comment #6
mrawat commented+1
Comment #7
zenimagine commented+1
Comment #8
roman_l commentedI'm disappointed to see no answer to this. Near 5000 installs and no tip from the users nor the devs ?
Anyway, first thanks for this great module which, i think, should be a part of DC core (weight and dimensions are needed for shipping rules and price calculations!).
Let's explain how to render the total order weight in a view, and then, show this view in a panel.
You'll need two modules : views_php (see doc for enabling php text format) and commerce_views_pane.
Enable them, create a new view with format "Commerce Checkout Pane".
Add a contextual filter : Commerce order id, with default value "current user order id".
Add a new hidden field "order id".
Add a new field "global : php".
In this field enter the code below :
And voilà ! enable the pane in your order workflow and see the total order weight rendered.
You can use this code in any view where you can get the order_id (cart summary, cart, ...), in rules, custom module...
@kevster (3 years late sorry) : if you want to show, for example, each product unit weight in the cart or line items view, you must alter the views and add a "commerce product referenced by line item" relationship, then the field "commerce product : weight" will be available to add in the table.
Hope it helps, and sorry for my bad english !
With this post you'll find the view export so you can import it (beware : default language of the store i work for is French). If i have time to, i'll try to commit a patch to include the view in the module.
Comment #9
zenimagine commentedGreat. Thank you very much.
Comment #10
mrawat commentedThanks for this @piactif
Is it possible to show order weight in the cart?
Comment #11
roman_l commented@mrawat yes as the shopping cart has an order id
Comment #12
sano commentedFor cases when one needs to use the weight in a rule:
<?php ?>tags:from the code.