Open ioweb-gr opened 1 month ago
Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, 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@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :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.
@ioweb-gr Did you added new div with [data-block="minicart"]
@ananth-iyer In the html there are two instances of [data-block="minicart"]
one for each minicart block
This is an example http://polr.ioweb.gr/PQLCC
Hi @engcom-November. 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. Hello @ioweb-gr,
Thank you for the report and collaboration!
Verified this on 2.4-develop. Added minicart in the footer, when clicking the minicart it opens up at the default location. Please take a look at the screencast:
Hence Confirming this issue.
Thank you.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12579 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Thank you :) any idea for a quick patch for this? It's a really pestering bug
Summary
The minicart element can't be used twice in the same page due to harcoded bindings.
For example in Magento_Checkout::js/view/minicart.js you can see that it will hook into [data-block="minicart"] without any possibility to override this.
In some other cases when you have a header bar that's displayed on desktop and a different one tht's displayed on mobile you may still experience the issue.
Basically we're only left with trying to move around the minicart using jquery instead of being able to toggle it's visibility per case.
When using two of them, one of them won't be able to display it's dropdown.
Unless I'm missing in which case please correct me, this looks like something that wasn't intended.
Examples
Here's a sample layout that's not really possible without jQuery due to the limitation of the minicart
In this case randomly one of the two minicarts won't display it's dropdown.
Proposed solution
The binding element should be decided by the config of the ui component as in other components.
From minicart.phtml you see that the binding is on element
[data-block='minicart']
In the config of the ui compoment the binding element selector should be possible to configure so that we can use unique identifiers.
An alternative solution would be when there are multiple elements with the same functionality
[data-block='minicart']
It should bind to both of them properly and make sure the dropdown works.
Release note
No response
Triage and priority