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

#   wrong product\_weight\_unit in checkout

##

- **[Joomill](/forum/user/33738-joomill "View Joomill's Profile")**
- [![Joomill's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33738.jpg)](/forum/user/33738-joomill "View Joomill's Profile") Topic Author
- [ Offline](/forum/user/33738-joomill)

Less More

- Posts: 224
- Thank you received: 10
-
-
- [](http://www.joomill.nl)
-

2 years 8 months ago [\#359214](#359214) by [Joomill](/forum/user/33738-joomill "View Joomill's Profile")  *[wrong product\_weight\_unit in checkout](/forum/25-install-update/907777-wrong-product-weight-unit-in-checkout#359214 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 3  Hi,  I have something strange: My client uses &quot;Doos&quot; as product&#95;weight&#95;unit in the backend  it is set in the settings  it is also fine in the database  in the frontend (listing) it's fine  But when i add this product to the cart it shows / kg  When i var&#95;dump the product in cart it shows kg as product&#95;weight&#95;unit  Can you see what's going wrong here? Kind regards, Jeroen Moolenschot")* was created by *[Joomill](/forum/user/33738-joomill "View Joomill's Profile")*

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 3

Hi,

I have something strange:
My client uses "Doos" as product_weight_unit in the backend

####  Attachment not found

it is set in the settings

####  Attachment not found

it is also fine in the database

####  Attachment not found

in the frontend (listing) it's fine

####  Attachment not found

But when i add this product to the cart it shows / kg

####  Attachment not found

When i var_dump the product in cart it shows kg as product_weight_unit

####  Attachment not found

Can you see what's going wrong here?
Kind regards,
Jeroen Moolenschot

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

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

Less More

- Posts: 4820
- Thank you received: 652
-
-

2 years 8 months ago -  2 years 8 months ago [\#359216](#359216) by [Philip](/forum/user/34318-philip "View Philip's Profile")  Replied by *[Philip](/forum/user/34318-philip "View Philip's Profile")* on topic *[wrong product\_weight\_unit in checkout](/forum/25-install-update/907777-wrong-product-weight-unit-in-checkout#359216 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 3  Hi,  I have something strange: My client uses &quot;Doos&quot; as product&#95;weight&#95;unit in the backend  it is set in the settings  it is also fine in the database  in the frontend (listing) it's fine  But when i add this product to the cart it shows / kg  When i var&#95;dump the product in cart it shows kg as product&#95;weight&#95;unit  Can you see what's going wrong here? Kind regards, Jeroen Moolenschot")*

Hello,

We will need these elements to progress on your suject :
- An **Url link** to your administrator (backend)
-Backend user **references** (with maximum ACL)
Note : Use our **[ Contact us](https://www.hikashop.com/support/contact-us.html)** form to provide these elements, and don't forget to add an **Url link to this topic**.
Regards

Last edit: 2 years 8 months ago by [Philip](/forum/user/34318-philip "View Philip's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNzc3Ny13cm9uZy1wcm9kdWN0LXdlaWdodC11bml0LWluLWNoZWNrb3V0P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86363
- Thank you received: 14297
-
-

2 years 8 months ago [\#359241](#359241) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[wrong product\_weight\_unit in checkout](/forum/25-install-update/907777-wrong-product-weight-unit-in-checkout#359241 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 3  Hi,  I have something strange: My client uses &quot;Doos&quot; as product&#95;weight&#95;unit in the backend  it is set in the settings  it is also fine in the database  in the frontend (listing) it's fine  But when i add this product to the cart it shows / kg  When i var&#95;dump the product in cart it shows kg as product&#95;weight&#95;unit  Can you see what's going wrong here? Kind regards, Jeroen Moolenschot")*

Hi,

The first weight unit in the list of the configuration becomes the main one of your shop.
So you configured "kg" as the main one.
On the product page, you see Doos because the page is relative to this product.
However, once the product is in the cart, the weight of all the products are converted to the main weight unit so that the total weight of the cart can be calculated for the shipping methods.
And since HikaShop doesn't know how to convert a doos to a kilo, it just use the same value.
If you scroll down on your var_dump, you should see an attribute product_weight_unit_orig which contains the weight unit before the conversion, as well as a product_weight_orig with the weight before the conversion.

It seems that you've customized product / listing_price to display product_weight_unit after the product price. So you'll need to amend your code to display product_weight_unit_orig if available and if not product_weight_unit so that you can get the display you want.

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

2 years 8 months ago [\#359375](#359375) by [YZCommunicatie](/forum/user/55788-yzcommunicatie "View YZCommunicatie's Profile")  Replied by *[YZCommunicatie](/forum/user/55788-yzcommunicatie "View YZCommunicatie's Profile")* on topic *[wrong product\_weight\_unit in checkout](/forum/25-install-update/907777-wrong-product-weight-unit-in-checkout#359375 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 3  Hi,  I have something strange: My client uses &quot;Doos&quot; as product&#95;weight&#95;unit in the backend  it is set in the settings  it is also fine in the database  in the frontend (listing) it's fine  But when i add this product to the cart it shows / kg  When i var&#95;dump the product in cart it shows kg as product&#95;weight&#95;unit  Can you see what's going wrong here? Kind regards, Jeroen Moolenschot")*

I tried to change the code but when i look in the var_dump it says:

public 'product_weight_unit_orig' =&gt; string 'Kg' (length=2)

While the original unit is "Doos", so this also doesn't shows the right information.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNzc3Ny13cm9uZy1wcm9kdWN0LXdlaWdodC11bml0LWluLWNoZWNrb3V0P3RtcGw9bWFya2Rvd24=) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86363
- Thank you received: 14297
-
-

2 years 8 months ago [\#359386](#359386) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[wrong product\_weight\_unit in checkout](/forum/25-install-update/907777-wrong-product-weight-unit-in-checkout#359386 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 3  Hi,  I have something strange: My client uses &quot;Doos&quot; as product&#95;weight&#95;unit in the backend  it is set in the settings  it is also fine in the database  in the frontend (listing) it's fine  But when i add this product to the cart it shows / kg  When i var&#95;dump the product in cart it shows kg as product&#95;weight&#95;unit  Can you see what's going wrong here? Kind regards, Jeroen Moolenschot")*

Hi,

I see what the problem is.
Change the code: Code:

$product-&gt;product_weight_orig = $product-&gt;product_weight; $product-&gt;product_weight_unit_orig = $product-&gt;product_weight_unit;

to: Code:

if(!isset($product-&gt;product_weight_orig)) $product-&gt;product_weight_orig = $product-&gt;product_weight; if(!isset($product-&gt;product_weight_unit_orig)) $product-&gt;product_weight_unit_orig = $product-&gt;product_weight_unit;

in the file administrator/components/com_hikashop/classes/cart.php and it should be fine.
We'll make that change on our end too for the next version of HikaShop.

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

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

Less More

- Posts: 8
- Thank you received: 1
-
-

2 years 8 months ago [\#359397](#359397) by [YZCommunicatie](/forum/user/55788-yzcommunicatie "View YZCommunicatie's Profile")  Replied by *[YZCommunicatie](/forum/user/55788-yzcommunicatie "View YZCommunicatie's Profile")* on topic *[wrong product\_weight\_unit in checkout](/forum/25-install-update/907777-wrong-product-weight-unit-in-checkout#359397 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 3  Hi,  I have something strange: My client uses &quot;Doos&quot; as product&#95;weight&#95;unit in the backend  it is set in the settings  it is also fine in the database  in the frontend (listing) it's fine  But when i add this product to the cart it shows / kg  When i var&#95;dump the product in cart it shows kg as product&#95;weight&#95;unit  Can you see what's going wrong here? Kind regards, Jeroen Moolenschot")*

Great! This works.

Thank you.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwNzc3Ny13cm9uZy1wcm9kdWN0LXdlaWdodC11bml0LWluLWNoZWNrb3V0P3RtcGw9bWFya2Rvd24=) 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.075 seconds

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