-
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
The 'promotion' region of the minicart is never rendered #25373
Comments
Hi @mattijv. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @mattijv do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @mattijv. Thank you for your report.
The fix will be available with the upcoming 2.4.0 release. |
Preconditions (*)
Steps to reproduce (*)
Expected result (*)
Actual result (*)
Cause
The issue was introduced in #20383 where an if-binding was added to the minicart-widgets div to prevent the div from being rendered if the 'promotion' region does not contain any elements. Unfortunately the if was written badly as the conditional is checking the
length
property of the observable returned from getRegion (always 0) instead of the array contained in the observable. This means the conditional is always false and the element is never rendered.Possible fixes
I've create two mutually exclusive PR's that solve the issue in two ways.
#25374 Fixes the if-clause by adding the missing parentheses.
#25375 Is a bit more involved fix as it adds a separate method to the collection component that can be used to check if a region contains elements. It also modifies existing uses of the
getRegion(region)().length
pattern to use the new method.The text was updated successfully, but these errors were encountered: