Implemented Flash Sale Page with Filter and Quick Buy features #932
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.
Overview:
This PR introduces the implementation of a Flash Sale Page that showcases limited-time discounted products. The page is designed to display products that are on sale with their original price, discounted price, brand, image, and countdown timer showing the remaining time for the sale.
Features:
Product Listing:
Countdown Timer:
endTime
for each product.Responsive Layout:
Sorting by Time:
endTime
, with the products that have less time remaining displayed first. This helps users focus on the deals that are about to end soonest.Maximum Discount Price Limit:
Product Image:
/placeholder.svg
) is used for each product, with the ability to adjust its size dynamically via query parameters (e.g., height and width) for uniform product images.Implementation Details:
Product Data: The product information (e.g., name, brand, prices, sale end time, etc.) is stored in an array of objects. Each product has an
id
,name
,brand
,originalPrice
,discountedPrice
,image
, andendTime
.Dynamic Countdown: The countdown timer for each product is calculated using JavaScript's
Date.now()
method to compare the current time with theendTime
of the product. It is updated every second.Product Card Layout: Each product is displayed in a card-like UI element that includes:
Sorting Logic: Products are sorted by the remaining time until their sale ends. This ensures that the products with the least time remaining are shown first, driving urgency.
Screenshot :
flash.mp4
Notes:
Customization: The flash sale page can be easily customized to include more products or adjust the discount rules.
Future Enhancements: We can add features like:
Closes Create Flash Sale Page for Sale #923