[Skip to main content](#vessel-content)

#   Display Product Weight in original format/unit

##

- **[jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")**
- [![jtquinto's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31780-jtquinto "View jtquinto's Profile") Topic Author
- [ Offline](/forum/user/31780-jtquinto)

Less More

- Posts: 30
- Thank you received: 2
-
-

6 years 7 months ago [\#317074](#317074) by [jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")  *[Display Product Weight in original format/unit](/forum/27-checkout/899456-display-product-weight-in-original-format-unit#317074 "-- HikaShop version -- : Business 4.2.2  I'm trying to display the product weight in the Shopping Cart (and Checkout Cart), but when I access $product-&gt;product&#95;weight and $product-&gt;product&#95;weight&#95;unit, it shows them in the general cart weight.  For example: a 50g product and a 1Kg product show &quot;0.05kg&quot; and &quot;1,000kg&quot;, respectively. I'd like to be able show them as &quot;50g&quot; and &quot;1Kg&quot; on the product line-items.  How can I show the product weight in their original unit/values? (items have &quot;50g&quot; and &quot;1kg&quot; as their actual weight entries)")* was created by *[jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")*

-- HikaShop version -- : Business 4.2.2

I'm trying to display the product weight in the Shopping Cart (and Checkout Cart), but when I access $product-&gt;product_weight and $product-&gt;product_weight_unit, it shows them in the general cart weight.

For example: a 50g product and a 1Kg product show "0.05kg" and "1,000kg", respectively. I'd like to be able show them as "50g" and "1Kg" on the product line-items.

How can I show the product weight in their original unit/values? (items have "50g" and "1kg" as their actual weight entries)  [ ![Untitled-2x.jpg](/forum/attachment/48981) ](/forum/attachment/48981 "Untitled-2x.jpg")

- [ ![Untitled-2x.jpg](/forum/attachment/48981) ](/forum/attachment/48981 "Untitled-2x.jpg") [ ](/forum/attachment/48981?download=1 "Untitled-2x.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTQ1Ni1kaXNwbGF5LXByb2R1Y3Qtd2VpZ2h0LWluLW9yaWdpbmFsLWZvcm1hdC11bml0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

6 years 7 months ago [\#317079](#317079) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Product Weight in original format/unit](/forum/27-checkout/899456-display-product-weight-in-original-format-unit#317079 "-- HikaShop version -- : Business 4.2.2  I'm trying to display the product weight in the Shopping Cart (and Checkout Cart), but when I access $product-&gt;product&#95;weight and $product-&gt;product&#95;weight&#95;unit, it shows them in the general cart weight.  For example: a 50g product and a 1Kg product show &quot;0.05kg&quot; and &quot;1,000kg&quot;, respectively. I'd like to be able show them as &quot;50g&quot; and &quot;1Kg&quot; on the product line-items.  How can I show the product weight in their original unit/values? (items have &quot;50g&quot; and &quot;1kg&quot; as their actual weight entries)")*

Hi,

In the variable $product of the view file used to display this area, the weight and unit are converted during the loading of the cart so that the total weight of the cart can be calculated for shipping methods.
So to get the original weight and unit, you should find them in the attributes $product-&gt;product_weight_orig and $product-&gt;product_weight_unit_orig or you can even reload the product data from the hikashop_product table with a MySQL query if necessary.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTQ1Ni1kaXNwbGF5LXByb2R1Y3Qtd2VpZ2h0LWluLW9yaWdpbmFsLWZvcm1hdC11bml0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")**
- [![jtquinto's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31780-jtquinto "View jtquinto's Profile") Topic Author
- [ Offline](/forum/user/31780-jtquinto)

Less More

- Posts: 30
- Thank you received: 2
-
-

6 years 7 months ago [\#317323](#317323) by [jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")  Replied by *[jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")* on topic *[Display Product Weight in original format/unit](/forum/27-checkout/899456-display-product-weight-in-original-format-unit#317323 "-- HikaShop version -- : Business 4.2.2  I'm trying to display the product weight in the Shopping Cart (and Checkout Cart), but when I access $product-&gt;product&#95;weight and $product-&gt;product&#95;weight&#95;unit, it shows them in the general cart weight.  For example: a 50g product and a 1Kg product show &quot;0.05kg&quot; and &quot;1,000kg&quot;, respectively. I'd like to be able show them as &quot;50g&quot; and &quot;1Kg&quot; on the product line-items.  How can I show the product weight in their original unit/values? (items have &quot;50g&quot; and &quot;1kg&quot; as their actual weight entries)")*

Hi, Nicolas. Thanks for the reply.

I tried displaying $product-&gt;product_weight_orig in the checkout cart block view but I got the same output.
The first 0.5Kg is the output of $product-&gt;product_weight, and the one in parentheses is for $product-&gt;product_weight_orig.

[ ![Untitled-3.jpg](/forum/attachment/49031) ](/forum/attachment/49031 "Untitled-3.jpg")

- [ ![Untitled-3.jpg](/forum/attachment/49031) ](/forum/attachment/49031 "Untitled-3.jpg") [ ](/forum/attachment/49031?download=1 "Untitled-3.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTQ1Ni1kaXNwbGF5LXByb2R1Y3Qtd2VpZ2h0LWluLW9yaWdpbmFsLWZvcm1hdC11bml0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

6 years 7 months ago [\#317328](#317328) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display Product Weight in original format/unit](/forum/27-checkout/899456-display-product-weight-in-original-format-unit#317328 "-- HikaShop version -- : Business 4.2.2  I'm trying to display the product weight in the Shopping Cart (and Checkout Cart), but when I access $product-&gt;product&#95;weight and $product-&gt;product&#95;weight&#95;unit, it shows them in the general cart weight.  For example: a 50g product and a 1Kg product show &quot;0.05kg&quot; and &quot;1,000kg&quot;, respectively. I'd like to be able show them as &quot;50g&quot; and &quot;1Kg&quot; on the product line-items.  How can I show the product weight in their original unit/values? (items have &quot;50g&quot; and &quot;1kg&quot; as their actual weight entries)")*

Hi,

And you confirm that this product has 500g configured in its settings ? Not 0.5kg ?
Then just reload the data from the database like that: Code:

$class = hikashop_get('class.product'); $data = $class-&gt;get($product-&gt;product_id); echo $data-&gt;product_weight.' '.$data-&gt;product_weight_unit;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTQ1Ni1kaXNwbGF5LXByb2R1Y3Qtd2VpZ2h0LWluLW9yaWdpbmFsLWZvcm1hdC11bml0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")**
- [![jtquinto's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/31780-jtquinto "View jtquinto's Profile") Topic Author
- [ Offline](/forum/user/31780-jtquinto)

Less More

- Posts: 30
- Thank you received: 2
-
-

6 years 7 months ago [\#317352](#317352) by [jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")  Replied by *[jtquinto](/forum/user/31780-jtquinto "View jtquinto's Profile")* on topic *[Display Product Weight in original format/unit](/forum/27-checkout/899456-display-product-weight-in-original-format-unit#317352 "-- HikaShop version -- : Business 4.2.2  I'm trying to display the product weight in the Shopping Cart (and Checkout Cart), but when I access $product-&gt;product&#95;weight and $product-&gt;product&#95;weight&#95;unit, it shows them in the general cart weight.  For example: a 50g product and a 1Kg product show &quot;0.05kg&quot; and &quot;1,000kg&quot;, respectively. I'd like to be able show them as &quot;50g&quot; and &quot;1Kg&quot; on the product line-items.  How can I show the product weight in their original unit/values? (items have &quot;50g&quot; and &quot;1kg&quot; as their actual weight entries)")*

Great! That did it. ![:)](/media/kunena/emoticons/3.png ":)")
Thanks, Nicolas!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5OTQ1Ni1kaXNwbGF5LXByb2R1Y3Qtd2VpZ2h0LWluLW9yaWdpbmFsLWZvcm1hdC11bml0P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.070 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
