magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

[Issue] Weight 0 for bundle products #34952

Closed manuelcanepa closed 2 years ago

manuelcanepa commented 2 years ago

Preconditions (*)

  1. Magento 2.4.3-p1
  2. Bundle product with Configurable child
  3. Ship Bundle Items: Together
  4. All simple products, childs of configurable must have weight > 0
  5. Configurable weight: 0

Steps to reproduce (*)

  1. Choose bundle product on frontend
  2. Go to cart
  3. Estimate shipping rates

Expected result (*)

  1. On a shipping carrier, the method collectRates(RateRequest $request), calling $request->getPackageWeight() will return > 0

Actual result (*)

  1. $request->getPackageWeight() return 0
  2. This method does not include bundles logic:

https://github.com/magento/magento2/blob/302f6c52138221d511b0e1742f94cd43f68aa6f3/app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php#L152-L231


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 2 years ago

Hi @manuelcanepa. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

manuelcanepa commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @manuelcanepa. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @manuelcanepa, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

m2-assistant[bot] commented 2 years ago

Hi @engcom-Echo. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:


engcom-Echo commented 2 years ago

Hi @manuelcanepa, 
 Thank you for reporting the issue.
 However, we tried to reproduce it on Magento 2.4.3-p1/2.4-dev but the issue is not reproducible.
 Steps followed to reproduce issue:

  1. Installed the fresh Magento 2.4-dev/2.4.3-p1 instance.
  2. Created bundle product with the configurable product as child product.
  3. Setup weight for child configurable product. 
  4. Added product to the cart and created order.
  5. Able to place the order successfully. (attached screenshots). 
1 - Screenshot 2022-01-11 at 1 54 49 PM 2 - Screenshot 2022-01-11 at 1 55 09 PM 3 - Screenshot 2022-01-11 at 1 57 38 PM
  1. Observed the function $request->getPackageWeight() output on the “fedex/Model/Carrier.php” and it shows the correct weight, see the below screenshot ( attach screenshot). 
4 - Screenshot 2022-01-11 at 7 35 16 PM
  1. Also observed the function output “getAssignmentWeightData()”, it has the weight value as well (attached screenshot)
5 - Screenshot 2022-01-11 at 1 53 56 PM

If the issue still persists at your end then please provide some more details or provide the exact steps, accordingly, I’ll try to reproduce it again.

Thanks

manuelcanepa commented 2 years ago

The issue occur when you set Ship Bundle Items as Together on the bundle config: image

vendor/magento/module-quote/Model/Quote/Address/Total/Shipping.php image

In order to workaround this issue, i just set Ship Bundle Items as Separately and works fine: image

I'm not sure if it's the desired functionality or a bug, but I don't think it's correct. Is this work as intended?

engcom-Echo commented 2 years ago

Hi @manuelcanepa,

I have tried the way you said. Updated bundle product configuration “Ship Bundle Items” as “Together” on the bundle config, and tested the scenario again and I still get the package weight in shipping and shipping carrier file ($request->getPackageWeight()). See the attached screenshot. It seems the shipping and carrier working as expected.

Screenshot 2022-01-17 at 7 11 32 PM

Hope it helps. Let me know if you are still facing this issue or provide more relevant details if you think it is a Magento core issue.

Thank You

manuelcanepa commented 2 years ago

I will keep with the premise: I dont know if this is a issue. I find how to reproduce. The weight is set on simple products. If i set weight on configurable, is working fine (Together or Separately). The way to reproduce this issue is setting weight ONLY on simple product. I suppose that is an issue because in some cases the simples may have differents weights based on his attributes. Think on flour as a configurable and simples selled by weight, if i setup configurable with 1kg and select option with 0.5kg i will have a difference between selection and weight calculated.

manuelcanepa commented 2 years ago

btw, i need to metion @engcom-Echo ?

engcom-Hotel commented 2 years ago

Hi @manuelcanepa, We are not able to reproduce this issue, it would be good if you provide the exact steps and the issue so that I can reverify and confirm it.

Thanks

manuelcanepa commented 2 years ago

Im sorry, i just realize that you need to install this extension: https://marketplace.magento.com/ewave-extendedbundleproduct.html So, no, is not a bug of magento vanilla.