Move a script loading from a snippet to a template to avoid an issue. #3263
+4
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Summary:
This PR fixes an issue that occurred in the console In the original PR which was supposed to be a start point for all further PRs.
The idea is to get approvals for this PR and use it as a start point for the further PRs instead of this one.
@sofiamatulis asked me to keep her PR as it is so we are not aiming to merge this PR now but we will merge the future PRs into this one 🙂.
Why are these changes introduced?
A loading script
<script src="{{ 'quick-add-bulk.js' | asset_url }}" defer="defer"></script>
was sitting in the snippet and that way the same variable was declared as many times as the snippet was rendered on the same page (template). This caused multiple issues in the console 👇What approach did you take?
I move the loading script from the snippet to the template and add a condition when we want to load the script.
Visual impact on existing themes
There is no visual impact.
Testing steps/scenarios
Demo links
Checklist