Closed m2-assistant[bot] closed 4 months ago
Hi @engcom-Bravo. 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:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. @magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://2f5b4426bca9085531cfd5b372a69717.instances-prod.magento-community.engineering Admin access: https://2f5b4426bca9085531cfd5b372a69717.instances-prod.magento-community.engineering/admin_bcd8 Login: 2511023d Password: 323873661a27
Hi @bhoopatparmar,
Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the attached screenshots.
Manual testing scenarios (*)
Bundle Product is adding without bundle options to the cart.
Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-11779 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Hi there, is there any update on this issue? We have seen the same thing occur when setting up a bundle product with 3 or 4 products with all required options.
@magento give me 2.4-develop instance
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.
Hi @engcom-Bravo, here is your Magento Instance: https://2f5b4426bca9085531cfd5b372a69717.instances-prod.magento-community.engineering Admin access: https://2f5b4426bca9085531cfd5b372a69717.instances-prod.magento-community.engineering/admin_d5b5 Login: f74f5bee Password: bc09fc92d9c7
Hi @bhoopatparmar,
As per this https://github.com/magento/magento2/pull/38601#issuecomment-2213301852 since it was fixed we are closing this issue.
Thanks.
This issue is automatically created based on existing pull request: magento/magento2#38601: Fixes: Bundle product with only one product in required bundle option not being added to cart with bundle option.
Description (*)
Adding a bundle product to the cart from the product list widget doesn’t let the product be added properly with the bundle option. The bundle product options are not added within the parent product. It shows a warning message in minicart like ‘Please specify product option(s)’. It doesn’t fail in all the cases, it only fails in a certain case where a bundle product has been created with a required bundle option & the bundle option contains only one product with the ‘is_default’ checkbox selected.
Screenshot 1: Here you can see in the screenshot a bundle product has been created with a bundle option containing only one product in it & the option is required and the product is default select.
Screenshot 2: After creating a bundle product, a widget has been created with a type of Catalog Product List & a condition that matches the particular bundle product.
Screenshot 3: As we have created a widget, a bundle product is visible on the home page in the widget.
Screenshot 4: When we click on the add-to-cart button, the product seems to be added to the cart & it doesn’t throw any error. And then if you check in the mini-cart, you will come to see a warning message like “Please specify product option(s).”
The same thing works fine on a list page, but it fails while adding a product to the cart through the widget.
Manual testing scenarios (*)
Expected result (*)
The bundle product should be added to the cart with bundle options.
Actual result (*)
The bundle product isn’t being added to the cart with bundle options.
Additional Information (*)
File1:
Magento/CatalogWidget/view/frontend/templates/product/widget/content/grid.phtml
File2:Magento/Catalog/view/frontend/templates/product/list.phtml
If we check in the above-given list.phtml, it gets the option by using the ViewModel & which works fine on the list page. (see screenshot 5). Screenshot 5:
In the given
grid.phtml
file it doesn’t get the options data where the add-to-cart form is rendered for the particular product (see screenshot 6). As the options are not rendered, adding that product to the cart will only add the parent bundle product to the cart without any bundle options. So, we need to implement the same thing aslist.phtml
to get the data ingrid.phtml
.Screenshot 6:
Solution (*)
We have to update the given phtml to get the bundle options in the add-to-cart form. We can get the bundle product options by using the
Magento\Catalog\ViewModel\Product\OptionsData
ViewModel. (see screenshot 7)A separate function has been created in the block file of the
grid.phtml
(Magento\CatalogWidget\Block\Product\ProductsList
) to get the ViewModel that returns the object ofMagento\Catalog\ViewModel\Product\OptionsData
.Screenshot 7:
Contribution checklist (*)