UI/UX: Add "Color Swatch Selection" on Product Cards - #7942
Open
pradeep0153 wants to merge 1 commit into
Open
Conversation
Welcome to Cara! 🛍️Thank you so much for opening this pull request. We really appreciate your contribution to this e-commerce platform! Next Steps:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #7941.
Description
When viewing a grid of products on
shop.html, users often want to know what other colors an item comes in without having to click through to the individual product page and wait for it to load. Adding small, interactive color swatches directly to the product cards allows users to preview color variations quickly and seamlessly directly from the catalog.Implementation Details
features/color-swatch-selectiondirectory to prevent any merge conflicts with the core template.shop.html, a select few product cards (.pro) are updated to serve as examples for multi-color items. Inside the product description area (near the price or title), a small container for color swatches (.color-swatches) is added.divelements are created within that container, each styled with a different CSSbackground-colorrepresenting the available options (e.g.,#ff0000,#0000ff,#000000).click(ormouseenter) events on these specific color swatches.srcattribute of that specific card's main product image to point to the image corresponding to the selected color..active-swatchclass (like a slightly thicker border or an inner shadow) to indicate which color is currently being previewed.README.mddetails how to pass dynamic image paths for different colors from a backend database to these swatches.Impact
This highly requested e-commerce feature drastically improves the browsing experience. By exposing product variety upfront, it increases user engagement with the catalog and helps customers find exactly what they are looking for faster.