-
Notifications
You must be signed in to change notification settings - Fork 34
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
Replace MSE SDK with direct access to ACDL #19
base: elsie-base-design
Are you sure you want to change the base?
Conversation
Is this removing events for sensei? My understanding is that the MSE SDK is needed to send events to sensei. Is this possible through ACDL? ( I have a limited understanding here lol) |
@MichaelHeinzman MSE SDK is a wrapper around ACDL which introduces some overhead. ACDL itself is pending some improvements in this regard as well. For Edge Delivery storefronts in particular, we try to keep the implementation as lightweight as possible. From an eventing / Sensei perspective, this PR does not change or break any existing functionality. |
Oh okay thank you, I'll look into it more then. |
if (categorySearch) { | ||
magentoStorefrontEvtPublish?.categoryResultsView && | ||
magentoStorefrontEvtPublish.categoryResultsView(SEARCH_UNIT_ID); | ||
if (categorySearch && categoryId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 Should this be an or condition instead? Everywhere else seems to have a fallback of category path first, then category id.
This is particularly an issue with Edge Delivery since the content is the same across all backend environments, and category IDs vary per environment. We would need to make an initial graphql call to get the category ID based on the category path and then initiate this widget
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justinconabree I think the and condition is required here as the categoryId is required for retrieving the full category data required for setting the category context. While the category path can still be used to display a PLP (compared to search results), it's not possible to use the category path alone to perform a categories
GraphQL query to get the full data required for the storefront events.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 Got it! What would the solution be then for an Edge implementation? Fetching the category ID before initializing the dropin? 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now we add the category id in the markup to pass it to the widget like here https://www.aemshop.net/gear.md.
If you have multiple environments which use different ids, you could introduce different content sources per environment. https://www.aem.live/docs/repoless could be helpful for creating multiple projects with dedicated content sources per environment with a shared code base.
Alternatively, as you suggested you can do another query to retrieve the category id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 to clarify, by environment I mean staging VS production. Normally we wouldn't setup a new project between environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I'm referring to. Normally it's sufficient to use the same content source and code base for all environments and rely on different config files as done in the boilerplate. If you have more complex content processes (different content between prod and stage), creating multiple repoless projects is one way to solve this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@herzog31 this is what we do as well. Our configuration file for staging points to the sandbox Catalog Service (configured to use staging Commerce's data), and our production config file uses production Catalog Service and production Commerce data.
We'll consider setting up a project for each environment going forward, though this is not ideal
Description
categories
query to retrieve category information.categoryContext
required for product recommendations.currentCategoryId
.currentCategoryId
is provided, it will also be used as filter forproductSearch
.apiUrl
configuration parameter.Motivation and Context
How Has This Been Tested?
See hlxsites/aem-boilerplate-commerce#11
Types of changes
Checklist: