-
Notifications
You must be signed in to change notification settings - Fork 142
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
Einstein API to support product sets #962
Conversation
// handle sets for viewProduct | ||
return { | ||
id: product.id, | ||
sku: product.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.
I think for product sets we can avoid having a separate case and let any product within the set that doesn't have variants fall through to the else block.
That's because I'm not sure if it's relevant for us to be sending 'sku' if it is the same as the regular 'id'.
Also, are there any changes we need to make in einstein.test.js?
Otherwise, the changes look good to me.
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.
The einstein test file only tests for whether the event sends the expected api request. I don't think any changes need to be made since there are no new 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.
Thanks for following up on my comment @yunakim714, LGTM.
* Product sets: basic PLP (#878) * Show product sets on PLP (alongside other products) For now, the product sets would look the same as any other kinds of products. * Parse the product type * Add todo * Ignore linting of this line for now * Add "Starting at" label * Product sets: basic pdp (@W-12301851@) (#897) * Product set: render the children products with minimal UI * No longer showing breadcrumbs in the child items * Individual swatches now have correct `value` There was a subtle bug where the `value` of the SwatchGroup was passed down to override all the values of the children Swatch components. * 1st attempt at saving swatches state in the page url * Avoid null in the url search params * Some refactoring * Add-to-cart now works for child items * Show accordion for each child item * Add todo * Rename variable for accuracy The child product itself is actually not a set, but is considered a set product. * Optional argument * Some refactoring and fix linting * Helper hook for url search params * Clean up * Rename module for a specific use case (PDP) * Show/hide add-to-cart buttons accordingly * Modal shows product set data * Parent product * Variant's product image shows up in add-to-cart modal * Rename variables for clarity * Fix linting error * Add horizontal rules to separate the parent and child items * Tweak whitespace * Localize the Starting At label * Add todo * Product sets: wishlist (@W-12301966@) (#917) * Starting At label * 1st attempt at updating wishlist for product sets * "Select Options" → "View Options" * Some refactoring * Render add-all-to-cart button if necessary * Better way to fetch `setProducts` data * Switch to zzrf-009 temporarily * For debugging purpose I'll revert this commit later * Simpler requirement * Update what quantity meant for product set * Some refactoring * Add comment * Add-to-wishlist for the individual child items * Rename variable * Update button text on PDP * Update button text on Wishlist page * Revert "Switch to zzrf-009 temporarily" This reverts commit 484c8d8. * PDP: show wishlist button on mobile * Fix formatting issues (prettier) * PR feedback * Clearer as to which is product or variant * Make it consistent with addToWishlist signature * [Feature] Add `Add Set to Cart` Button for Product Sets (#931) * Product sets: basic PLP (#878) * Variant's product image shows up in add-to-cart modal * Get modal showing multiple items added to cart * Add scroll to after validation Co-authored-by: Vincent Marta <[email protected]> * Einstein API to support product sets (#962) * verify viewcategory and viewsearch is working * viewproduct event is sent for every child product * addtocart event fires for all children when add set to cart * parent set only sends id * Design enhancements for product sets (#975) * remove complete the set carousel * remove complete the set translations * sticky buttons on mobile view * fix modal vertical margins on desktop * move recos to modalbody and cleanup margins * add dividers between product set items in mobile view * fix margins so sticky buttons do not overlap with content * add lazy loading of product set children product images * remove height - does nothing * bump build size to 55 * add conditional for complete the set and change loading var name * lint * revert translations * Cleanup * added to cart modal is scrollable and 90% of viewport * remove dialogprops * lint * Testing product sets - @W-12414116@ (#1003) * Product tile: test product set's price label * Test product set rendering * Test callbacks are called properly * itemAccumulatedCount is redundant * Test that modal can render multiple products * Finally the add-to-cart modal shows up in testing * Clean up * Test error messages * Test lazy loading of the child products * Split a test into smaller ones * Use `describe` to group all the related tests * Update comment * Test the wishlist and its primary action buttons * Clean up * Some refactoring * Some refactoring * Linting fix * Update comment * Test `getDisplayVariationValues` * Test the usePDPSearchParams * Tweak another test to pass Not related to product sets, but needing CI to pass. * Move mocked data into their own files * Moving it to within `beforeEach` --------- Co-authored-by: Ben Chypak <[email protected]> Co-authored-by: yunakim714 <[email protected]>
Description
This PR enables product sets data to be forwarded through Einstein activities so that we can visualize product sets data on reports and dashboards.
We are forwarding data for the following events:
Types of Changes
Changes
How to Test-Drive This PR
npm start
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization