5 Best Vacuum For Steps: Expert-Approved & Top-Rated

Cleaning stairs can be a real hassle, right? Whether you have carpeted steps, hardwood, or a mix, getting into those tight corners and removing stubborn pet hair or dust often feels like an impossible task. Traditional upright vacuums are too bulky, and smaller models might lack the power. That’s why finding the best vacuum for steps is crucial for maintaining a truly clean home. You need something lightweight, powerful, and versatile enough to tackle every tread and riser with ease.

Quick Product Comparison

.modern-product-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: white;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 8px 32px rgba(0,0,0,0.1);
font-size: 14px;
}
.modern-product-table thead th {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 10px 8px;
text-align: left;
font-weight: 600;
font-size: 15px;
border: none;
}
.modern-product-table tbody td {
padding: 10px 8px;
border-bottom: 1px solid #f0f0f0;
vertical-align: middle;
}
.modern-product-table tbody tr:last-child td {
border-bottom: none;
}
.product-name {
font-weight: 600;
color: #2d3748;
font-size: 14px;
line-height: 1.4;
max-width: 300px;
}
.product-name a {
color: inherit;
text-decoration: none;
}
.product-name a:hover {
color: #ff6b35 !important;
}
.product-image-cell {
text-align: center;
width: 80px;
}
.product-image-cell img {
width: 60px;
height: 60px;
object-fit: cover;
border-radius: 8px;
border: 2px solid #e2e8f0;
transition: transform 0.2s ease;
}
.product-image-cell img:hover {
transform: scale(1.05);
}
.price-button-cell {
text-align: center;
width: 140px;
}
.price-button {
display: inline-block;
background: linear-gradient(135deg, #ff9900 0%, #ff6b35 100%);
color: white;
padding: 8px 12px;
text-decoration: none !important;
border-radius: 6px;
font-weight: 600;
font-size: 13px;
box-shadow: 0 2px 8px rgba(255,153,0,0.3);
transition: all 0.2s ease;
white-space: nowrap;
}
.price-button:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(255,153,0,0.4);
}
@media (max-width: 768px) {
.modern-product-table {
font-size: 13px;
}
.modern-product-table thead th {
padding: 8px 6px;
font-size: 14px;
}
.modern-product-table tbody td {
padding: 8px 6px;
}
.product-name {
font-size: 13px;
max-width: 200px;
}
.product-image-cell img {
width: 50px;
height: 50px;
}
.price-button {
padding: 6px 10px;
font-size: 12px;
}
}
@media (max-width: 480px) {
.modern-product-table {
font-size: 12px;
}
.modern-product-table thead th {
padding: 6px 4px;
font-size: 13px;
}
.modern-product-table tbody td {
padding: 6px 4px;
}
.product-name {
font-size: 12px;
max-width: 150px;
}
.product-image-cell {
width: 60px;
}
.product-image-cell img {
width: 40px;
height: 40px;
}
.price-button-cell {
width: 120px;
}
.price-button {
padding: 5px 8px;
font-size: 11px;
}
}

<!–

–>

<!–

–>

<!–

–>

<!–

–>

<!–

–>

Product Image Check Price
1. BISSELL Pet Hair Eraser Cordless Hand Vacuum, Ideal for Pet Hair on Steps and Upholstery…. BISSELL Pet Hair Eraser Cordless Hand Vacuum, Ideal for Pet Hair on St ⭐ 4.5/5 Check Price
2. BLACK+DECKER Cordless Handheld Pet Vacuum, Portable dust buster with Pet Brush for Steps…. BLACK+DECKER Cordless Handheld Pet Vacuum, Portable dust buster with P ⭐ 4.1/5 Check Price
3. Shark Rocket Ultra-Light Corded Bagless Vacuum, Ideal for Cleaning Steps, Carpet, and Hard Floors…. Shark Rocket Ultra-Light Corded Bagless Vacuum, Ideal for Cleaning Ste ⭐ 4.4/5 Check Price
4. Bissell Pet Hair Eraser Cordless Hand Vacuum, Perfect for Steps with Crevice and Motorized Tools…. Bissell Pet Hair Eraser Cordless Hand Vacuum, Perfect for Steps with C ⭐ 4.2/5 Check Price
5. Lightweight Cordless Handheld Vacuum, Portable with Strong Suction for Pet Hair on Steps…. Lightweight Cordless Handheld Vacuum, Portable with Strong Suction for ⭐ 4.6/5 Check Price

Our Top 5 Best Vacuum For Steps Reviews – Expert Tested & Recommended

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

🏆 Best Choice

1. BISSELL Pet Hair Eraser Cordless Hand Vacuum, Ideal for Pet Hair on Steps and Upholstery.

BISSELL Pet Hair Eraser Cordless Hand Vacuum, Ideal for Pet Hair on Steps and Upholstery.

If you have pets and struggle with fur on your stairs, the BISSELL Pet Hair Eraser is an absolute game-changer. This cordless handheld vacuum is specifically engineered to tackle embedded dirt and pesky pet hair, making it one of the best vacuums for steps, especially carpeted ones. Its portability and strong suction mean you can keep your home fur-free without any cords getting in the way.

Key Features That Stand Out

  • Motorized Brush Tool: Designed to actively lift and remove embedded pet hair and dirt from various surfaces.
  • Cordless Convenience: Powered by a 14V lithium-ion battery for flexible cleaning anywhere, without being tied to an outlet.
  • Lightweight Design: Extremely easy to carry up and down stairs, reducing fatigue during cleaning sessions.
  • Large Dirt Bin: Allows for longer cleaning sessions before needing to be emptied, perfect for multiple flights of stairs.

Why We Recommend It

We highly recommend the BISSELL Pet Hair Eraser because it truly excels at its core purpose: pet hair removal. The motorized brush is incredibly effective on carpeted steps and upholstery, making quick work of even the most stubborn fur. Its cordless nature provides unmatched freedom, letting you reach every nook and cranny on your stairs without tripping over cords.

Best For

This vacuum is ideal for pet owners with carpeted stairs, upholstered furniture, and cars. It’s also great for quick clean-ups of dry spills and general dust on various surfaces.

Pros and Cons

Pros:
  • Excellent at picking up pet hair thanks to the specialized motorized tool.
  • Cordless design offers superior mobility and ease of use on stairs.
  • Lightweight and comfortable to hold for extended cleaning.
  • Easy to empty and maintain the dirt bin and filters.
Cons:
  • Battery life might be limited for very large homes with many stairs.
  • Suction strength is optimized for pet hair but might be less powerful than some corded models for heavy debris.
  • Can be a bit noisy during operation.

Customer Reviews

Customer Review: The BISSELL Pet Hair Eraser Cordless Hand Vacuum has been a big help around my home and car. It’s lightweight, easy to maneuver, and the battery lasts long enough to clean furniture and small messes without constantly recharging. The suction is strong for a handheld, and it does a great job pulling.

Customer Review: I love this handheld vacuum! I have two long-haired cats and a German Shepherd so everything I own is always covered in fur. This vacuum is very convenient to spot clean areas where fur has built up or to clean up loose litter around the litter box. It has great suction and will pick up just about a.

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

⭐ Editor’s Choice

2. BLACK+DECKER Cordless Handheld Pet Vacuum, Portable dust buster with Pet Brush for Steps.

BLACK+DECKER Cordless Handheld Pet Vacuum, Portable dust buster with Pet Brush for Steps.

The BLACK+DECKER Cordless Handheld Pet Vacuum is a formidable contender for the best vacuum for steps, especially if you need versatile cleaning power. This dust buster is designed with pet owners in mind, boasting a powerful motor and a specialized pet brush that makes quick work of embedded hair on stairs and upholstery. Its cordless design allows for maximum maneuverability.

See also  Top 5 Best Hose Clamp Pliers: Unbeatable Quality, Expert Reviewed

Key Features That Stand Out

  • 20V MAX* Lithium-Ion Battery: Delivers high suction power for effective cleaning and long-lasting performance.
  • POWERBOOST Mode: Provides an extra burst of suction for tackling tougher messes and deeply embedded pet hair with the touch of a button.
  • Pet Brush Tool: Specifically designed to agitate and lift pet hair from various surfaces, including carpeted stairs.
  • Easy-to-Empty Dirt Bowl: Features a large capacity and simple emptying mechanism for convenient maintenance.

Why We Recommend It

We chose the BLACK+DECKER Pet Vacuum as an Editor’s Choice because of its robust suction and the incredibly useful POWERBOOST mode, which is fantastic for deep cleaning those high-traffic stair areas. Its reliable battery and dedicated pet brush make it a strong option for households dealing with pet dander and dirt on multiple levels. It’s a very user-friendly stair vacuum.

Best For

This vacuum is perfect for pet owners looking for strong, sustained suction on stairs and other hard-to-reach areas. It’s also great for quick clean-ups in the car or around the house, thanks to its cordless design.

Pros and Cons

Pros:
  • Exceptional suction power, especially with the POWERBOOST feature.
  • Ergonomic design makes it comfortable for cleaning stairs.
  • Pet brush attachment is highly effective for fur removal.
  • Easy to clean filter and dirt bowl, reducing maintenance hassle.
Cons:
  • Can be a bit heavier than some other handheld models.
  • Charging time for the battery can be lengthy.
  • Some users might find it a bit loud on its highest setting.

Customer Reviews

Customer Review: This little vacuum is a beast. Hands down the best little hand held vacuum. I use this to vacuum my furniture and beds. It works so well I ordered another one for my vehicle. I have a SUV and this is perfect to keep it clean inside. The suction is very strong. Hold a great charge about 45mins. Has 2.

Customer Review: Awesome! Nice power and SO easy to clean!Charging takes a bit, but this little thing has strong suction, perfect for vacuuming carpeted stairs. It is so simple to clean the filter: just pull it out and you can wash it in the sink. I love that the roller brush is made of rubber vs. fine synthetic bri.

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

💰 Best Budget

3. Shark Rocket Ultra-Light Corded Bagless Vacuum, Ideal for Cleaning Steps, Carpet, and Hard Floors.

Shark Rocket Ultra-Light Corded Bagless Vacuum, Ideal for Cleaning Steps, Carpet, and Hard Floors.

For those seeking a versatile and budget-friendly option, the Shark Rocket Ultra-Light Corded Bagless Vacuum stands out as a top choice for cleaning stairs. Weighing under 9 lbs, this stick vacuum easily converts into a powerful handheld unit, making it an excellent stair vacuum solution. Its corded design ensures consistent, strong suction without worrying about battery life.

Key Features That Stand Out

  • Ultra-Lightweight Design: At under 9 lbs, it’s incredibly easy to carry and maneuver, especially when cleaning steps.
  • 2-in-1 Versatility: Converts from an upright stick vacuum to a portable handheld unit for floor-to-ceiling cleaning.
  • Powerful Corded Suction: Delivers consistent, strong suction for carpets and hard floors without power fade.
  • Fingertip Controls: Easily switch between different cleaning modes for various surfaces without bending over.

Why We Recommend It

The Shark Rocket is a fantastic budget option because it offers the power of a full-sized vacuum in a compact, portable form. Its ability to transform into a handheld vacuum is invaluable for stairs, allowing you to clean thoroughly without lugging a heavy machine. The corded design means uninterrupted cleaning power, which is a huge plus for longer cleaning tasks.

Best For

This vacuum is ideal for individuals looking for a single, versatile vacuum cleaner that can handle both floors and stairs. It’s excellent for homes with mixed flooring types and those who prefer continuous power over battery-operated convenience.

Pros and Cons

Pros:
  • Very lightweight and easy to maneuver up and down stairs.
  • Strong, consistent suction due to its corded power supply.
  • Versatile; cleans both hard floors and carpets effectively.
  • Affordable price point for its performance and features.
Cons:
  • Requires plugging and unplugging between outlets, which can be cumbersome on long staircases.
  • Smaller dustbin capacity compared to traditional uprights.
  • The cord can sometimes get in the way during handheld use.

Customer Reviews

Customer Review: So this is my favorite stick. Vacuum always has been my other one held up until the stick didn’t want to stay up anymore. It kept falling over and so I donated it to my church and they use it and it works quite well. Still, it still sucks up everything. It still works. This one here is a bit differe.

Customer Review: Don’t walk, RUN to buy this vacuum! Here are a few highlights: great at picking up dirt, dust bunnies, etc., long cable, works well on tile/wood floors, area rugs and carpet, strong suction, easy cleanup and affordable!

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

4. Bissell Pet Hair Eraser Cordless Hand Vacuum, Perfect for Steps with Crevice and Motorized Tools.

Bissell Pet Hair Eraser Cordless Hand Vacuum, Perfect for Steps with Crevice and Motorized Tools.

Another excellent entry from BISSELL, this Pet Hair Eraser Cordless Hand Vacuum is a robust solution for tackling pet hair and debris on steps. Designed for maximum flexibility, its cordless operation combined with specialized tools makes it one of the most effective options for a thorough stair vacuum cleaning, especially in homes with furry friends.

Key Features That Stand Out

  • Cordless Design: Offers complete freedom to clean anywhere your pet goes without restrictions.
  • Motorized Brush Tool: Provides powerful suction and agitation for a deep clean on carpeted steps and upholstery.
  • Crevice Tool: Essential for reaching into tight corners and edges on stairs where dust and pet hair often accumulate.
  • Upholstery Tool: Perfect for cleaning larger surface areas like pet beds, couches, and larger portions of carpeted stairs.
See also  5 Best Dyson Vacuums for Hardwood Floors: Experts Want You to Know

Why We Recommend It

We recommend this Bissell Pet Hair Eraser for its dedicated tools and cordless versatility. The motorized tool paired with the crevice and upholstery attachments means no hair or dirt spot on your stairs is safe. It’s specifically built to make vacuuming steps with pet hair an easy and efficient task, giving you more time to enjoy your clean home.

Best For

This vacuum is best for multi-pet households that need targeted cleaning for pet hair on stairs, furniture, and in vehicles. It’s also suitable for homes with intricate stair designs that benefit from specialized crevice tools.

Pros and Cons

Pros:
  • Excellent range of attachments for versatile pet hair removal on all stair types.
  • Cordless feature makes it highly portable and easy to use on multiple flights of stairs.
  • Strong suction, particularly effective with the motorized tool for deep cleaning.
  • Compact size allows for easy storage in smaller spaces.
Cons:
  • Battery runtime might be limited for very extensive cleaning tasks.
  • Can be a bit loud, especially when using the motorized brush.
  • May require frequent emptying of the small dirt bin if cleaning heavily soiled areas.

Customer Reviews

Customer Review: This bissell, vacuum cleaner for dog beds is the best. I have tried many! Always disappointed with the results.It’s very seldom when you buy something and it delivers everything it claims.This hand held vacuum cleaner literally erases the dog hair on the beds. It works like a Dyson. It’s a well-mad.

Customer Review: I purchased this vac in 2017, and it has held up to almost daily use, mostly for quickly cleaning up cat litter and kibble, and functioning as a dust pan after using a broom to sweep the floors. As it has aged, the battery no longer charges, but it had a good 8 year run and its replacement will be.

h3 { transition: color 0.2s ease; } h3:hover { color: #ff6b35; }

5. Lightweight Cordless Handheld Vacuum, Portable with Strong Suction for Pet Hair on Steps.

Lightweight Cordless Handheld Vacuum, Portable with Strong Suction for Pet Hair on Steps.

This Lightweight Cordless Handheld Vacuum is a fantastic all-rounder, offering powerful suction and versatile attachments that make it an excellent choice for cleaning steps. Its portability and strong cyclonic suction are particularly effective at picking up pet hair and fine debris, proving that you don’t need a bulky machine for a deep clean on your stairs.

Key Features That Stand Out

  • 15000PA Cyclonic Strong Suction: Delivers powerful and consistent suction to effectively pick up dirt, dust, and pet hair.
  • Versatile Cleaning Attachments: Includes a long suction nozzle, brush suction nozzle, and extended hose for various cleaning needs.
  • Fast Charging & Long Battery Life: Equipped with a high-capacity 7800mAh battery providing up to 30 minutes of runtime.
  • Lightweight and Portable: Designed for easy handling and transport, making it ideal for cleaning steps and cars.

Why We Recommend It

We’re impressed by this handheld vacuum’s balance of power and portability, making it a strong contender for the best vacuum for steps. The 15000PA suction is surprisingly robust for a compact unit, and the range of attachments ensures you can tackle any type of stair surface, from carpet to hardwood, and reach into tight crevices. The generous battery life is also a huge plus for comprehensive cleaning.

Best For

This vacuum is ideal for apartment dwellers, car owners, and anyone needing a reliable, powerful handheld vacuum for quick daily cleanups or deeper cleaning of stairs and upholstery.

Pros and Cons

Pros:
  • Very powerful suction for its compact size, effective on pet hair and debris.
  • Comes with a useful array of attachments for diverse cleaning scenarios on stairs.
  • Good battery life (up to 30 minutes) and quick charging.
  • Extremely lightweight and easy to handle, reducing strain during stair cleaning.
Cons:
  • Dustbin capacity might be insufficient for very large messes or whole-house cleaning.
  • No specific motorized brush tool for deeply embedded carpet dirt.
  • Sound level could be an issue for some users at max suction.

Customer Reviews

Customer Review: This is a great vacuum cleaner for my car. It is light and easy to use, picks up crumbs and dust well, which is a lifesaver for me as my daughter always likes to snack in the car. I also like that it has several attachments that are convenient to use in different parts of the car. The battery lasts.

Customer Review: This handheld vacuum is lightweight, powerful, and perfect for quick cleanups in the car or at home. The suction is strong, and it comes with several useful attachments that make cleaning corners and small spaces easy. The rechargeable battery lasts well, and it’s very convenient to store and carry.

Complete Buying Guide for Best Vacuum For Steps

Choosing the best vacuum for steps can feel overwhelming with so many options out there. It’s not just about finding a small vacuum; it’s about finding one that perfectly fits your specific cleaning needs, stair type, and lifestyle. This guide will walk you through the essential factors we considered when making our recommendations, ensuring you make an informed decision for your home.

Essential Factors We Consider

When searching for the ideal stair vacuum, several key features make all the difference:

  • Weight and Portability: This is arguably the most critical factor. Lugging a heavy vacuum up and down stairs is exhausting and dangerous. Look for models under 10 pounds, with handheld options being the lightest and most maneuverable. A lightweight design drastically improves the ease and frequency of cleaning.
  • Suction Power: While portability is key, it shouldn’t come at the expense of power. Strong suction is necessary to effectively lift pet hair, dirt, and debris from carpet fibers and hard surfaces alike. For pet owners, a vacuum with a motorized brush tool is a must-have for embedded fur.
  • Corded vs. Cordless: Each has its pros and cons. Cordless vacuums for steps offer unparalleled freedom of movement, making them ideal for homes with multiple flights of stairs or tricky layouts. However, they are limited by battery life. Corded models provide continuous, consistent power, which is great for deeper, longer cleans, but you’ll have to manage the cord.
  • Attachments and Tools: The right accessories can transform your stair cleaning experience. A crevice tool is essential for tight corners, while a brush tool is great for agitating carpet or gently cleaning hard surfaces. Pet hair attachments, especially those with motorized brushes, are invaluable for furry friends.
  • Dustbin Capacity: For a small handheld vacuum, a larger dustbin means less frequent emptying during a cleaning session. While smaller than full-sized vacuums, a decent capacity ensures you can clean a full staircase without interruption.
  • Filter System: Look for easy-to-clean, washable filters. This maintains suction power over time and reduces ongoing costs. HEPA filters are a bonus for allergy sufferers.
  • Versatility: Can the vacuum clean more than just stairs? Many great stair vacuums double as excellent car vacuums, upholstery cleaners, or quick-spot cleaners around the house.
See also  5 Best Cheap Vacuum Cleaners: Expert Reviewed for True Value

Budget Planning

The price range for the best vacuum for steps can vary significantly, typically from around $50 for basic handheld models to over $200 for premium stick vacuums with advanced features. Consider your budget and how often you’ll use the vacuum. If it’s for daily pet hair touch-ups, a more affordable handheld might suffice. For whole-home versatility including stairs, investing a bit more in a 2-in-1 stick vacuum could be a better long-term choice. Remember that consistent performance and durability often correlate with a slightly higher price point, but there are excellent budget-friendly options too!

Final Thoughts

Ultimately, the best vacuum for steps is the one that makes your cleaning routine easier and more effective. Consider the type of stairs you have (carpeted, hardwood), whether you have pets, and how often you’ll be cleaning. A cordless, lightweight handheld with specialized tools is often the winner for pet owners and quick clean-ups, while a powerful 2-in-1 corded stick vacuum might be better for those needing consistent, deep cleaning across various surfaces.

Frequently Asked Questions

Q: What type of vacuum is best for cleaning carpeted stairs?

A: For carpeted stairs, a handheld vacuum with a motorized brush attachment is often the best vacuum for steps. The motorized brush helps to agitate and lift embedded dirt and pet hair from carpet fibers, providing a deeper clean than suction alone. Stick vacuums that convert to handhelds with similar attachments are also highly effective.

Q: Can I use a regular upright vacuum cleaner on stairs?

A: While some upright vacuums come with hose attachments, using a full-sized upright vacuum directly on stairs is generally not recommended. They are too heavy, bulky, and awkward to maneuver safely, making the task inefficient and potentially dangerous. A dedicated stair vacuum (handheld or convertible stick) is much safer and more effective.

Q: How important is battery life for a cordless stair vacuum?

A: Battery life is very important for cordless stair vacuums. A longer battery life (typically 20-30 minutes) allows you to clean an entire staircase, and possibly other small areas, without needing to recharge halfway through. If you have many steps or plan on using the vacuum for more than just stairs, prioritize models with better battery performance.

Q: What are the key attachments needed for vacuuming stairs?

A: The most useful attachments for vacuuming steps include a crevice tool for getting into tight corners and along edges, a brush tool for dusting and gentle cleaning of hard surfaces or upholstery, and if you have pets, a motorized pet hair tool is indispensable for removing stubborn fur from carpet and fabric.

Q: How often should I vacuum my steps?

A: The frequency depends on household traffic, whether you have pets, and if you wear shoes indoors. For most homes, vacuuming stairs once a week is sufficient. However, if you have multiple pets or high foot traffic, you might find yourself needing to do a quick pass every 2-3 days to keep pet hair and dirt under control.

Choosing the best vacuum for steps can truly transform your cleaning routine, turning a dreaded chore into a manageable task. We hope our expert-tested reviews and comprehensive buying guide have equipped you with all the knowledge you need to find your perfect match. Say goodbye to dusty corners and embedded pet hair, and hello to sparkling stairs! Don’t wait – click through our affiliate links above to check the latest prices and bring home the ideal stair vacuum for your needs today.

// Fetch real-time product data for all products when page loads
(function() {
const products = [‘B07CB6RBSP’, ‘B07R89PJY6’, ‘B00DFBDALC’, ‘B01E0472TI’, ‘B0DSJ4MXYY’];
const affiliateTag = ‘arcweldingpro0d-20’;

async function fetchLiveProductData(asin) {
try {
const updateTimeEl = document.getElementById(‘update-time-‘ + asin);
if (updateTimeEl) updateTimeEl.innerHTML = ‘⏳ Fetching…’;

const amazonUrl = ‘https://www.amazon.com/dp/’ + asin;
const response = await fetch(‘https://api.allorigins.win/raw?url=’ + encodeURIComponent(amazonUrl));
const html = await response.text();
const parser = new DOMParser();
const doc = parser.parseFromString(html, ‘text/html’);

let price = null;
const priceWhole = doc.querySelector(‘.a-price-whole’);
const priceFraction = doc.querySelector(‘.a-price-fraction’);
if (priceWhole) {
price = ‘$’ + priceWhole.textContent.trim() + (priceFraction ? priceFraction.textContent.trim() : ”);
}

let rating = null;
const ratingEl = doc.querySelector(‘[data-hook=”average-star-rating”] .a-icon-alt’);
if (ratingEl) {
const match = ratingEl.textContent.match(/(\d+\.\d+)/);
if (match) rating = match[1];
}

let reviewCount = null;
const reviewEl = doc.querySelector(‘#acrCustomerReviewText’);
if (reviewEl) reviewCount = reviewEl.textContent.trim();

if (price) {
const priceEl = document.getElementById(‘price-‘ + asin);
if (priceEl) {
priceEl.innerHTML = price;
priceEl.style.animation = ‘pulse 0.5s’;
}
}

// if (rating) {
// const ratingEl = document.getElementById(‘rating-‘ + asin);
// if (ratingEl) {
// const stars = ‘⭐’.repeat(Math.floor(parseFloat(rating)));
// ratingEl.innerHTML = stars + ‘ ‘ + rating + ‘/5’;
// ratingEl.style.animation = ‘pulse 0.5s’;
// }
// }

if (reviewCount) {
const reviewsEl = document.getElementById(‘reviews-‘ + asin);
if (reviewsEl) {
reviewsEl.innerHTML = reviewCount;
reviewsEl.style.animation = ‘pulse 0.5s’;
}
}

if (updateTimeEl) {
const now = new Date();
const timeStr = now.toLocaleString(‘en-US’, {
month: ‘long’, day: ‘numeric’, year: ‘numeric’,
hour: ‘numeric’, minute: ‘2-digit’, hour12: true
});
updateTimeEl.innerHTML = ‘✓ Updated: ‘ + timeStr;
}
} catch (error) {
const updateTimeEl = document.getElementById(‘update-time-‘ + asin);
if (updateTimeEl) updateTimeEl.innerHTML = ‘✓ Cached data’;
}
}

const style = document.createElement(‘style’);
style.textContent = `@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }`;
document.head.appendChild(style);

function loadAllProducts() {
products.forEach((asin, index) => {
setTimeout(() => fetchLiveProductData(asin), index * 2000);
});
}

if (document.readyState === ‘loading’) {
document.addEventListener(‘DOMContentLoaded’, loadAllProducts);
} else {
loadAllProducts();
}
})();

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top