display order weight
11 years 11 months ago #176463
by lacasetta
my site with Hikashop
www.lacasettabio.it
display order weight was created by lacasetta
Hi,
is there a way to see the total weight of an order only on my backend?
Thanks
is there a way to see the total weight of an order only on my backend?
Thanks
my site with Hikashop
www.lacasettabio.it
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
11 years 11 months ago #176473
by Mohamed Thelji
Replied by Mohamed Thelji on topic display order weight
Hello,
To do that the solution will be to directly edit the code of the "show_products" file of the "Order" view of your back-end template via "Hikashop->Display->Views", note that some development skills will be required.
To do that the solution will be to directly edit the code of the "show_products" file of the "Order" view of your back-end template via "Hikashop->Display->Views", note that some development skills will be required.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #176568
by lacasetta
my site with Hikashop
www.lacasettabio.it
Replied by lacasetta on topic display order weight
Hi,
but has the system the total weight already calculated?
If yes, what is the name of the variable?
but has the system the total weight already calculated?
If yes, what is the name of the variable?
my site with Hikashop
www.lacasettabio.it
Please Log in or Create an account to join the conversation.
11 years 11 months ago #176580
by Xavier
Replied by Xavier on topic display order weight
Hi,
No it's not calculated, you will have to do a foreach on the products and increment a $weight variable for example and then display the value of this variable.
No it's not calculated, you will have to do a foreach on the products and increment a $weight variable for example and then display the value of this variable.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #176728
by lacasetta
my site with Hikashop
www.lacasettabio.it
Replied by lacasetta on topic display order weight
Hi,
like that it is too difficult for me.
But, why can not get the value of the shipping?
The system knows the weight because it has calculated the shipping cost.
like that it is too difficult for me.
But, why can not get the value of the shipping?
The system knows the weight because it has calculated the shipping cost.
my site with Hikashop
www.lacasettabio.it
Please Log in or Create an account to join the conversation.
11 years 11 months ago #176734
by Xavier
Replied by Xavier on topic display order weight
Hi,
The fees are calculated in earlier based on the weight, etc. But the weight is not stored in the order, only the fees.
So the foreach is required in this case
The fees are calculated in earlier based on the weight, etc. But the weight is not stored in the order, only the fees.
So the foreach is required in this case
Please Log in or Create an account to join the conversation.
11 years 11 months ago - 11 years 11 months ago #176993
by lacasetta
my site with Hikashop
www.lacasettabio.it
Replied by lacasetta on topic display order weight
Hi,
so, it is too difficult for me.
I hope that someone else ask you the same feature so that you can put it on your todo list!

Regards
so, it is too difficult for me.
I hope that someone else ask you the same feature so that you can put it on your todo list!
Regards
my site with Hikashop
www.lacasettabio.it
Last edit: 11 years 11 months ago by lacasetta.
Please Log in or Create an account to join the conversation.
11 years 4 months ago #201657
by jesper
Replied by jesper on topic display order weight
needed it for something else, so just did the code
Code:
$database = JFactory::getDBO();
$query = 'SELECT a.order_product_quantity,b.product_weight FROM ' .
hikashop_table('order_product') . ' as a LEFT JOIN ' . hikashop_table('product') .
' as b ON a.product_id=b.product_id WHERE order_id=' . $this->order->order_id .'';
$database->setQuery($query);
$rows = $database->loadObjectList();
$weight = 0;
foreach ($rows as $row) {
$weight += $row->order_product_quantity*$row->product_weight;
}
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 17
- Thank you received: 0
11 years 3 months ago #206360
by thirdhatch
Replied by thirdhatch on topic display order weight
Jesper, thank you for providing this! Can you tell me where this code snippet goes? Does it go on a particular line in show_products.php, or somewhere else?
Thanks!
Thanks!
Please Log in or Create an account to join the conversation.
11 years 3 months ago #206379
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic display order weight
Hi,
Regarding the code, it is related to the order ; so I think it's in the front-end display of the order or in the backend edition of the order.
Regards,
Regarding the code, it is related to the order ; so I think it's in the front-end display of the order or in the backend edition of the order.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
11 years 3 months ago #206581
by jesper
Replied by jesper on topic display order weight
It should be able to be used anywhere you could need it... i used it in the backend to calculate the total wieght of the order to send the info with the shipping module to the postal provider.
Please Log in or Create an account to join the conversation.
Time to create page: 0.282 seconds