-
Notifications
You must be signed in to change notification settings - Fork 9.4k
$_item->getChildren() returns empty array for parent cart items when cart is paginated #34507
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
Comments
Hi @samcleathero. Thank you for your report.
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:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 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. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento give me 2.4-develop instance with extensions samcleathero/m2-item-render-test Edit: this doesn't seem to have worked as I thought it would - hopefully somebody can take a look and figure out what I was trying to achieve! |
Hi @samcleathero. Thank you for your request. I'm working on Magento instance for you. |
Hi @samcleathero, here is your Magento Instance: https://b26a589b00d5c9d782886b45dab65007-2-4-develop.instances.magento-community.engineering |
Hi @engcom-Hotel. Thank you for working on this issue.
|
The bug is in vendor/magento/module-checkout/Block/Cart/Grid.php.
As a possible solution I would suggest to add a custom quote items collection for pagination case. |
Hi @samcleathero, Thank you for reporting the issue. We are successfully able to reproduce it on Magento 2.4-develop. Steps followed to reproduce issue:
Conclusion: Item property should not change before and after pagination applied to the cart items. Thanks |
✅ Jira issue https://jira.corp.magento.com/browse/AC-1735 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Hotel. Thank you for verifying the issue. |
@magento I am working on this |
…lterCollection method
I can confirm this is still an issue in 2.4.6, created a pull request to Magento with a solution. Until this has been solved, you can use the following patch
|
Preconditions (*)
Steps to reproduce (*)
$_item->getChildren()
to get child items of configurable products - I am using this to get stock levels for child products when a configurable product is added to the cart. For demo purposes, I have var_dumped$_item->getHasChildren()
in the screenshots below.$_item->getHasChildren()
returnsNULL
for simple products, and(bool)true
for configurable products. When pagination is triggered,$item->getHasChildren()
returnsNULL
for all products, including configurables with children.Expected result (*)
var_dump($_item->getHasChildren())
should return(bool)true
for configurable products.$_item->getChildren()
should also return an Magento\Quote\Model\Quote\Item\AbstractItem array. This screenshot shows it working correctly for a cart where pagination has not been triggered.Actual result (*)
var_dump($_item->getHasChildren())
actually returnsNULL
for configurable products.$_item->getChildren()
also returns an empty array. This screenshot is taken once enough products have been added to the cart to trigger pagination.Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: