wrong product_weight_unit in checkout
2 years 7 months ago #359214
by Joomill
wrong product_weight_unit in checkout was created by Joomill
-- HikaShop version -- : 5.0.3
-- Joomla version -- : 3
Hi,
I have something strange:
My client uses "Doos" as product_weight_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_dump the product in cart it shows kg as product_weight_unit
Can you see what's going wrong here?
Kind regards,
Jeroen Moolenschot
-- 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 or Create an account to join the conversation.
2 years 7 months ago - 2 years 7 months ago #359216
by Philip
Replied by Philip on topic wrong product_weight_unit in checkout
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 form to provide these elements, and don't forget to add an Url link to this topic.
Regards
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 form to provide these elements, and don't forget to add an Url link to this topic.
Regards
Last edit: 2 years 7 months ago by Philip.
Please Log in or Create an account to join the conversation.
2 years 7 months ago #359241
by nicolas
Replied by nicolas on topic wrong product_weight_unit in checkout
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.
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 or Create an account to join the conversation.
Less
More
- Posts: 8
- Thank you received: 1
2 years 7 months ago #359375
by YZCommunicatie
Replied by YZCommunicatie on topic wrong product_weight_unit in checkout
I tried to change the code but when i look in the var_dump it says:
public 'product_weight_unit_orig' => string 'Kg' (length=2)
While the original unit is "Doos", so this also doesn't shows the right information.
public 'product_weight_unit_orig' => string 'Kg' (length=2)
While the original unit is "Doos", so this also doesn't shows the right information.
Please Log in or Create an account to join the conversation.
2 years 7 months ago #359386
by nicolas
Replied by nicolas on topic wrong product_weight_unit in checkout
Hi,
I see what the problem is.
Change the code:
to:
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.
I see what the problem is.
Change the code:
Code:
$product->product_weight_orig = $product->product_weight;
$product->product_weight_unit_orig = $product->product_weight_unit;
Code:
if(!isset($product->product_weight_orig))
$product->product_weight_orig = $product->product_weight;
if(!isset($product->product_weight_unit_orig))
$product->product_weight_unit_orig = $product->product_weight_unit;
We'll make that change on our end too for the next version of HikaShop.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 8
- Thank you received: 1
2 years 7 months ago #359397
by YZCommunicatie
Replied by YZCommunicatie on topic wrong product_weight_unit in checkout
Great! This works.
Thank you.
Thank you.
Please Log in or Create an account to join the conversation.
Time to create page: 0.191 seconds