0

I have a dynamic product which is based on user size input. On the basis of user size input I am calculating product price and weight.

I already set the product calculated price in custom price field of quote and set additional_options with all user input as custom option.

I also have to calculate the weight of the product based on user input and want to use it for shipping calculation.

I am trying to set product calculated weight in quote item as weight, but it get changed when quote refreshed or any extra activity on quote.

How do I set product custom weight in quote and used it in shipping method ?

  • Were you able to find a resolution to this? We have the same need. – Brit Mansell Nov 9 '17 at 0:25
0

Magento 2 : use Plugin for Type : Magento\Quote\Model\Quote\Item

after method setProduct() which is a public method. setWeight('123') and return the results.

public function afterSetProduct(\Magento\Quote\Model\Quote\Item $item, $results){


    $results->setWeight('80');

    return $results;

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.