How we can update the weight field value if the same product added two times in the cart. How we can update the weight value of the product?

For example-

If we add two same products in the cart, and then update the cart, the price field gets updated, same as if we want to update the weight field of the product, how we can do this?

Suppose-

Product 1 - Weight = 0.25
Product 1- Weight= 0.25
Total it should be - 0.5

Please, help me with this issue.

Comments

Kirti_uplytics created an issue. See original summary.

zenimagine’s picture

I have the same problem. Did you find a solution ?

joelpittet’s picture

Category: Feature request » Support request
Priority: Critical » Normal

This sounds like a support request, the quantity * weight should already work.

Are you saying this doesn't work, then maybe steps to reproduce would be helpful?

zenimagine’s picture

If I add to the cart :
1 product of 0.15 kg and 1 product of 0.20 kg, the sum is well of 0.35 kg.
If I add to the cart :
1 product of 0.15 kg and 5 products of 0.20 kg, the sum is not corect is always displays 0.35 kg.

The quantity column does not work with this module.

See screenshots.

joelpittet’s picture

Thanks @zenimagine, screenshots are always helpful. How are you getting the value being grabbed to show on the cart in your screenshots at the top.

"Le poids de votre panier est de 0.35 kg", where does that come from?

zenimagine’s picture

I used a mathematical formula in the view.

My question is, how to display on the cart total weight of the order ?

For the calculation of the shipping costs it works but to display the total weight to my customers it does not work.

joelpittet’s picture

You need to multiply the (line item quantity * weight) in your formula.

zenimagine’s picture

That's what I did.

Product1: 1kg; 3€; x2; Total 2kg
Product2: 1.5kg; 12€; x3; Total 4,5kg

With the formula I have the total weight of each product. My question is how to get the tatal weight of the order ? In my example ca should be 6.5kg

joelpittet’s picture

Double check the code you wrote, there may be something missing. Feel free to post the custom logic here

zenimagine’s picture

My question is, how to display the total weight of a command in a block ?
I want my customers to see the weight of their order on the cart and shipping page.
With a view it is not possible.
http://drupal.stackexchange.com/questions/225621/can-not-aggregate-a-glo...

zenimagine’s picture

I got an answer here :

https://www.drupal.org/node/2844407#comment-11878345

How to create a token with the total weight of the current user's command ?

bojanz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.