-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue] Fixes: Bundle product with only one product in required bundle option not being added to cart with bundle option. #38605
Comments
Hi @engcom-Bravo. Thank you for working on this issue.
|
@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 |
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. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-11779 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
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 |
Hi @bhoopatparmar, As per this #38601 (comment) since it was fixed we are closing this issue. Thanks. |
This issue is automatically created based on existing pull request: #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 (*)
The text was updated successfully, but these errors were encountered: