5 Best Vacuums for Hardwood & Rugs: Our Tested & Top-Rated Picks

Finding the best vacuum for hardwood and rugs can truly transform your cleaning routine. We all know the struggle: a vacuum that works wonders on carpets might scratch your delicate hardwood, or one designed for hard floors might just push debris around on your rugs. Achieving that perfect balance of powerful suction, gentle cleaning, and versatile functionality across different surfaces is key. In this roundup, we’ve put several popular models to the test to help you discover the ideal cleaning companion that excels on both your sleek hardwood floors and cozy area rugs, ensuring a spotless home without compromise.

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. Kenmore DS1030 Cordless Stick Vacuum: Lightweight 2-in-1 for Hardwood Floors, Rugs, and Pet Hair… Kenmore DS1030 Cordless Stick Vacuum: Lightweight 2-in-1 for Hardwood ⭐ 4.1/5 Check Price
2. Eureka ReactiSense 440 Cordless Stick Vacuum: Anti-Tangle Brushroll, 60-Min Runtime for Hardwood and… Eureka ReactiSense 440 Cordless Stick Vacuum: Anti-Tangle Brushroll, 6 ⭐ 4.4/5 Check Price
3. Shark Navigator Lift-Away Deluxe Upright Vacuum: HEPA Filter, Swivel Steering for Hardwood and Rugs… Shark Navigator Lift-Away Deluxe Upright Vacuum: HEPA Filter, Swivel S ⭐ 4.4/5 Check Price
4. Shark Rocket HV301 Ultra-Light Corded Vacuum: Bagless, Swivel Steering for Hardwood and Rugs… Shark Rocket HV301 Ultra-Light Corded Vacuum: Bagless, Swivel Steering ⭐ 4.4/5 Check Price
5. Eureka PowerSpeed NEU181A Upright Vacuum: Lightweight, Bagless for Hardwood Floors, Rugs, and Pets… Eureka PowerSpeed NEU181A Upright Vacuum: Lightweight, Bagless for Har ⭐ 4.3/5 Check Price

Our Top 5 Best Vacuum For Hardwood And Rugs Reviews – Expert Tested & Recommended

🏆 Best Choice


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

1. Kenmore DS1030 Cordless Stick Vacuum: Lightweight 2-in-1 for Hardwood Floors, Rugs, and Pet Hair

Kenmore DS1030 Cordless Stick Vacuum: Lightweight 2-in-1 for Hardwood Floors, Rugs, and Pet Hair

The Kenmore DS1030 is a versatile cordless stick vacuum designed to tackle cleaning challenges on both hardwood floors and rugs with ease. Its lightweight, 2-in-1 design allows for seamless transitions between floor types and converts into a handheld unit for quick clean-ups. With impressive battery life and convenient features, it’s a solid contender for anyone seeking a flexible and efficient vacuum.

Key Features That Stand Out

  • Lightweight 2-in-1 Design: Easily converts from a stick vacuum to a portable handheld unit.
  • 2 Speed Settings: Optimizes suction power for various surfaces, from delicate hardwood to deeper pile rugs.
  • EasyCut Nozzle: A unique feature that removes tangled hair and debris from the brushroll with the push of a button.
  • Up to 45 Minutes Run Time: Offers ample cleaning time on low mode, perfect for daily tidying without frequent recharging.

Why We Recommend It

We recommend the Kenmore DS1030 for its exceptional versatility and user-friendly design. The ability to switch between a stick and handheld vacuum makes it incredibly convenient for comprehensive cleaning tasks, from floors to furniture. Its specialized EasyCut nozzle is a game-changer for pet owners, effectively dealing with tangled hair and maintaining optimal performance on both hardwood and rugs.

Best For

This vacuum is best for pet owners and individuals living in homes with a mix of hardwood floors and area rugs who appreciate the flexibility of a lightweight, cordless design.

Pros and Cons

Pros:
  • Lightweight and easy to maneuver, reducing cleaning fatigue.
  • Excellent for tackling pet hair thanks to the innovative EasyCut nozzle.
  • Cordless convenience allows for unrestricted movement around the house.
  • Good battery life for a stick vacuum, sufficient for most daily cleaning tasks.
Cons:
  • Suction power might be reduced on higher settings, impacting battery life.
  • Dust bin capacity could be small for very large homes or heavy shedding pets.
  • Not ideal for deep carpet cleaning, more suited for low-pile rugs.

Customer Reviews

Customer Review: “Great quality product. Easy to use; lightweight….good suction, good battery life…..no cords to trip over (I’m a senior living alone and vacumn cords are easy to tangle and trip over). Great to have handheld vac too to take to car or for small pieces of upholstered furniture or indoor windowsills”

Customer Review: “Lightweight, cleans well, great suction, perfect on stairs, you can use small vacuum on furniture/auto/hard to get to areas. Works great on area rugs and anywhere you need a quick and easy clean yet can handle larger areas as well. I highly recommend this product.”

⭐ Editor’s Choice


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

See also  5 Best Rated Car Vacuum Cleaners: Expert Picks for a Pristine Clean

2. Eureka ReactiSense 440 Cordless Stick Vacuum: Anti-Tangle Brushroll, 60-Min Runtime for Hardwood and Rugs

Eureka ReactiSense 440 Cordless Stick Vacuum: Anti-Tangle Brushroll, 60-Min Runtime for Hardwood and Rugs

The Eureka ReactiSense 440 stands out as an intelligent cordless stick vacuum engineered for diverse homes. Its advanced features, particularly the anti-tangle brushroll and Smart Sense+React technology, make it incredibly effective for seamless cleaning across both hardwood and rugs. With a generous runtime and powerful suction, it promises a thorough and hassle-free cleaning experience.

Key Features That Stand Out

  • Anti-Tangle Brushroll: Special fins and comb-strips actively guide hair away, preventing clogs and maintaining powerful suction.
  • Smart Sense+React Technology: Automatically adjusts suction and brush speed based on dust levels and floor type (hardwood, tile, or carpet).
  • Powerful 350W Suction: Delivers robust cleaning performance for deep dirt and debris.
  • 60-Minute Runtime: Offers extended cleaning sessions on a single charge, ideal for larger areas.
  • Sealed H13 HEPA Filtration: Traps 99.95% of microparticles and odors, ensuring cleaner air and preventing leakage.

Why We Recommend It

The Eureka ReactiSense 440 is an excellent choice for its smart adaptability and pet-friendly design. The anti-tangle brushroll is a lifesaver for homes with pets, ensuring consistent performance without constant maintenance. Its ability to automatically adjust to different floor types, from delicate hardwood to various rugs, makes it a truly versatile and efficient cleaning solution, delivering powerful suction where it’s needed most.

Best For

This vacuum is best for pet owners and individuals living in homes with a diverse mix of floor types, especially those with hardwood floors and deep-pile rugs, who value intelligent automation and strong suction.

Pros and Cons

Pros:
  • Effectively prevents hair tangles on the brushroll, a huge plus for pet owners.
  • Automatic power adjustment ensures optimal cleaning for different surfaces without manual intervention.
  • Strong suction capable of deep cleaning on various floor types.
  • Long battery life supports thorough cleaning of larger homes.
  • HEPA filtration system improves air quality by trapping allergens.
Cons:
  • Higher price point due to advanced smart features.
  • May be slightly heavier than other stick vacuums due to powerful motor and battery.

Customer Reviews

Customer Review: “I recently bought this cordless vacuum cleaner and I’m really happy with the purchase. It’s lightweight, easy to carry around the house, and the suction power is surprisingly strong for a cordless model. Battery life is good enough for daily cleaning, and it charges quickly.I love that it reaches co”

Customer Review: “The Eureka ReactiClean 410 has exceeded my expectations. The suction is extremely strong for a cordless vacuum; it picks up dust and pet hair on hardwood, tile, and low-pile carpet with no problem. The tangle-resistant brush is a lifesaver for pet owners.Battery life is solid; Mid Mode easily gets m”

💰 Best Budget


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

3. Shark Navigator Lift-Away Deluxe Upright Vacuum: HEPA Filter, Swivel Steering for Hardwood and Rugs

Shark Navigator Lift-Away Deluxe Upright Vacuum: HEPA Filter, Swivel Steering for Hardwood and Rugs

The Shark Navigator Lift-Away Deluxe is a powerhouse upright vacuum that offers exceptional value and versatility for homes with both hardwood and rugs. Its innovative Lift-Away feature allows you to detach the canister for portable cleaning, making it incredibly adaptable. Coupled with a HEPA filter and swivel steering, it delivers powerful suction and easy maneuverability for a deep clean.

Key Features That Stand Out

  • Powerful Suction: Effectively deep-cleans carpets and tackles bare floors with multi-surface suction capabilities.
  • Lift-Away Functionality: Detachable pod allows for easy cleaning under furniture or above-floor areas like upholstery and stairs.
  • Anti-Allergen Complete Seal Technology + HEPA Filter: Traps dust and allergens inside the vacuum, ensuring cleaner air.
  • Swivel Steering: Provides excellent control and allows for easy navigation around furniture and obstacles.

Why We Recommend It

We highly recommend the Shark Navigator Lift-Away Deluxe for its robust cleaning power and incredible adaptability. The Lift-Away feature is particularly valuable for comprehensive cleaning, reaching areas that traditional upright vacuums can’t. Its combination of strong suction for rugs and gentle effectiveness on hardwood floors, plus the advanced allergy filtration, makes it an outstanding choice for diverse households on a budget.

Best For

This vacuum is best for allergy sufferers and homeowners with a mix of carpets, hardwood floors, and area rugs who need powerful, versatile cleaning without breaking the bank.

Pros and Cons

Pros:
  • Excellent suction power for both deep carpets and hard floors.
  • Versatile Lift-Away feature allows for portable and extended reach cleaning.
  • HEPA filtration is highly effective for trapping allergens, beneficial for sensitive individuals.
  • Swivel steering makes it easy to maneuver around obstacles.
Cons:
  • Can be heavier than stick vacuums in its upright configuration.
  • Corded design limits reach and requires outlet changes.
  • Brushroll might need to be manually turned off for very delicate hardwood to prevent scratches.

Customer Reviews

Customer Review: “Warning, it’s a long read, but I wanted to go into deep detail.To start, I have been a Rainbow vacuum user for so long. I love them and felt they worked amazingly.Next, I have 3 dogs & a cat. One is a thick coat lab and the cat sheds so much as well.Another next, I have horrible allergies and wanted”

Customer Review: “Definitely get this vacuum. I have a 1bd apartment that is 80% carpet and it works great. I am sure there are better vacuums out there but this vacuum will get a very good amount of your animals hair and dirt out of the carpet. The brush on it definitely works great however longer hair does get tan”

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

4. Shark Rocket HV301 Ultra-Light Corded Vacuum: Bagless, Swivel Steering for Hardwood and Rugs

Shark Rocket HV301 Ultra-Light Corded Vacuum: Bagless, Swivel Steering for Hardwood and Rugs

The Shark Rocket HV301 is a highly-rated ultra-light corded stick vacuum that offers impressive versatility for multi-surface homes. Weighing under 9 lbs, it effortlessly transforms into a handheld vacuum, providing powerful cleaning from floor to ceiling. Its strong corded suction and swivel steering make it an agile and effective tool for both hardwood floors and rugs.

See also  5 Best Cordless Handheld Vacuums: Our Top-Rated Expert Picks

Key Features That Stand Out

  • Ultra-Lightweight Design: Weighs under 9 lbs, making it easy to carry and maneuver for extended periods.
  • 2-in-1 Versatility: Converts from a stick vacuum to a convenient handheld unit for versatile cleaning.
  • Powerful Corded Suction: Delivers consistent, strong suction on both carpets and hard floors without battery limitations.
  • Fingertip Controls: Easily switch between surface settings for optimal cleaning on different floor types.
  • Swivel Steering: Enhances maneuverability, allowing it to glide around furniture and obstacles with ease.

Why We Recommend It

We recommend the Shark Rocket HV301 for its impressive power-to-weight ratio and versatile functionality. Despite its ultra-light design, it doesn’t compromise on suction, making it effective for deep cleaning on various floor types, including hardwood and rugs. The corded design ensures consistent power without worrying about battery life, and its easy conversion to a handheld mode adds significant value for comprehensive home cleaning.

Best For

This vacuum is best for users seeking a lightweight yet powerful vacuum for daily cleaning across hardwood floors and rugs, particularly those who prefer consistent corded power over battery limitations.

Pros and Cons

Pros:
  • Extremely lightweight, making it easy to lift, carry, and use on stairs.
  • Strong, consistent suction power thanks to its corded design.
  • Versatile for cleaning multiple surfaces, from floors to ceilings, with its handheld conversion.
  • Excellent maneuverability with swivel steering.
Cons:
  • Corded operation requires plugging and unplugging between rooms.
  • Dust cup capacity is relatively small compared to full-size upright vacuums.
  • May require manual adjustments for different rug thicknesses.

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: “I love that you can change settings between low rug/hardwood to carpeting/heavy rugs. It picks up all the dog hair and the no tangle self cleaning brush actually does what its supposed to do. Long cord makes it easier to go through the house without unplugging to many times. Not to heavy but defi”

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

5. Eureka PowerSpeed NEU181A Upright Vacuum: Lightweight, Bagless for Hardwood Floors, Rugs, and Pets

Eureka PowerSpeed NEU181A Upright Vacuum: Lightweight, Bagless for Hardwood Floors, Rugs, and Pets

The Eureka PowerSpeed NEU181A is a powerful yet remarkably lightweight bagless upright vacuum, perfect for homes needing effective cleaning across various surfaces. Designed with pet owners in mind, it delivers strong suction for both hardwood floors and rugs. Its extra-large dust cup and user-friendly features make daily cleaning a breeze, offering convenience and efficiency.

Key Features That Stand Out

  • Lightweight Yet Powerful: At just 10 pounds, it provides heavyweight cleaning performance without the bulk.
  • Strong Suction Across Surfaces: A 960-watt motor ensures consistent and powerful suction on multiple floor types, including hardwood, tile, and various rugs.
  • Extra-Large Dust Cup (2.6 liters): Reduces the frequency of emptying, allowing for longer, uninterrupted cleaning sessions.
  • Dynamic Brushroll: Adapts to different floor heights to effectively clean both bare floors and carpets.
  • Pet-Specific Tools: Includes attachments designed to easily pick up pet hair and dander.

Why We Recommend It

We recommend the Eureka PowerSpeed NEU181A for its impressive balance of power and portability, especially at its price point. It’s a fantastic option for homes with pets, effectively tackling stubborn hair on both hardwood floors and rugs. The large dust cup is a huge convenience, minimizing interruptions, while its lightweight design makes it easy to handle for quick clean-ups or full house vacuuming.

Best For

This vacuum is best for pet owners and busy households with a mix of hardwood floors and area rugs who need an easy-to-use, powerful, and lightweight upright vacuum for everyday cleaning.

Pros and Cons

Pros:
  • Exceptional suction power for a lightweight upright.
  • Very affordable, offering great value for its features.
  • Large dust cup means fewer trips to the trash bin.
  • Easy to maneuver and carry due to its light construction.
  • Effective on pet hair across multiple surfaces.
Cons:
  • Corded design, which may be inconvenient for larger homes.
  • Can be a bit loud during operation.
  • The filtration system isn’t HEPA-sealed, which might be a concern for severe allergy sufferers.

Customer Reviews

Customer Review: “My previous vacuum was by a very popular brand, and it was expensive. It had every feature that you could imagine and worked as an upright, canister, and handheld unit. I had it for years and hated it. Why? Because it was very heavy, unwieldy, and bulky. None of the accessories were mounted on the”

Customer Review: “I am close to 80 years old and I have had about every brand of vacuum on the market. My last vacuum weight 16 lb. and was hard to manuver. I saw this Eureka power speed model NEU180D which was 10 lb. and said it had great suction, with a turbo brush. I am so glad I got it. I have 3 large bird cages “

Complete Buying Guide for Best Vacuum For Hardwood And Rugs

Essential Factors We Consider

When searching for the best vacuum for hardwood and rugs, there are several crucial factors to keep in mind. First, consider the brushroll type. For hardwood, you’ll want a soft brushroll or the ability to turn off the brushroll to prevent scratches. For rugs, especially thicker ones, a powerful brushroll is essential for deep cleaning. Suction power is another non-negotiable; a strong motor ensures effective pickup of dust and debris from both smooth surfaces and carpet fibers. Look for vacuums with adjustable suction settings. Filtration systems are also important, particularly for allergy sufferers. HEPA filters are ideal for trapping fine dust and allergens, improving air quality. Finally, consider the vacuum’s weight and maneuverability. A lightweight design and swivel steering make it easier to navigate around furniture and switch between floor types effortlessly.

See also  5 Best Small Circular Saws: Expert Picks for Precision & Power

Budget Planning

Your budget plays a significant role in your vacuum choice. You can find excellent options for the best vacuum for hardwood and rugs across various price points, but generally, more advanced features like smart technology, longer battery life, and superior filtration come with a higher cost. Entry-level models, often corded uprights or stick vacuums, offer great value for basic cleaning needs. Mid-range options usually provide a good balance of features, performance, and durability. High-end cordless stick vacuums or premium uprights offer the most advanced technology, strong suction, and convenience. Determine what features are essential for your home and cleaning habits to ensure you get the best value without overspending.

Final Thoughts

Choosing the perfect vacuum for your home’s unique combination of hardwood floors and rugs requires a thoughtful approach. It’s not just about raw power; it’s about smart design, adaptability, and convenience. We’ve highlighted some top contenders that truly shine in these mixed-surface environments. By prioritizing brushroll versatility, adjustable suction, effective filtration, and ease of use, you can find a vacuum that not only meets but exceeds your cleaning expectations, keeping your home spotless and your air fresh.

Frequently Asked Questions

Q: What type of brushroll is best for hardwood floors and rugs?

A: For hardwood floors, a soft brushroll or a brushroll that can be turned off is ideal to prevent scratches. For rugs, especially those with deeper pile, a powerful motorized brushroll is necessary to agitate and lift dirt effectively. Many modern vacuums designed for mixed surfaces offer multi-floor settings or interchangeable heads to accommodate both.

Q: Is a cordless vacuum good for both hardwood and rugs?

A: Yes, many cordless stick vacuums are excellent for both hardwood and rugs. They offer unparalleled convenience and maneuverability. However, it’s important to check their suction power and battery runtime, as performance can vary. Look for models with different power modes and brush heads designed for multi-surface cleaning.

Q: How important is a HEPA filter for a vacuum used on hardwood and rugs?

A: A HEPA filter is very important, especially if you or anyone in your household suffers from allergies or asthma. It traps 99.97% of airborne particles as small as 0.3 microns, including pet dander, pollen, and dust mites. This is beneficial for both hardwood and rugs as it ensures that dust and allergens picked up are contained, leading to cleaner air in your home.

Q: Can a vacuum scratch my hardwood floors?

A: Yes, if not used correctly, a vacuum can scratch your hardwood floors. Vacuums with stiff bristles, strong brushrolls that cannot be turned off, or worn-out wheels can be problematic. Always ensure the brushroll is either off or set to a “hard floor” mode when cleaning hardwood. Opt for models with soft bristles or specialized hard floor attachments.

Q: How often should I vacuum my hardwood floors and rugs?

A: For hardwood floors, daily light vacuuming or sweeping is ideal to prevent dust and grit from accumulating and causing scratches. For rugs, vacuuming 2-3 times a week is generally sufficient, more often in high-traffic areas or if you have pets. Regular vacuuming helps maintain cleanliness and prolong the life of both your hardwood and rugs.

There you have it! Finding the best vacuum for hardwood and rugs doesn’t have to be a daunting task. By considering your specific needs, such as pet hair, allergies, or battery life, and matching them with the features of our top picks, you can confidently choose a vacuum that keeps every inch of your home impeccably clean. Don’t settle for anything less than a vacuum that truly understands and adapts to the diverse surfaces of your living space. Click on the “Check Price on Amazon” buttons above to explore these fantastic options further and make your home cleaning a breeze!

// Fetch real-time product data for all products when page loads
(function() {
const products = [‘B09QYB17J2’, ‘B0F9L92BTC’, ‘B00JH98GR4’, ‘B00DFBDALC’, ‘B091SWWH59’];
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