5 Best Cheap Cordless Vacuums: Expert Picks That Are Worth It

Are you on the hunt for the best cheap cordless vacuum that won’t break the bank but still delivers a spotless clean? You’re in luck! Cordless vacuums offer unparalleled convenience, freeing you from the hassle of tangled cords and limited reach. They’ve become a household essential, especially for quick cleanups and homes with pets or kids. But let’s be honest, premium models can come with a hefty price tag. That’s why we’ve scoured the market to find top-performing, budget-friendly options that prove you don’t need to spend a fortune for a clean home. We’ve put several popular models to the test, focusing on their suction power, battery life, versatility, and overall value. Get ready to discover a fantastic, affordable cleaning companion!

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 16V Cordless Stick Vacuum – Lightweight 2-in-1 Handheld, LED Headlight for Pet Hair & Floors… Kenmore 16V Cordless Stick Vacuum - Lightweight 2-in-1 Handheld, LED H Check Price
2. Electrolux Ergorapido Pet Cordless 2-in-1 Vacuum with Motorized Pet Nozzle, 48-Minute Run Time…. Electrolux Ergorapido Pet Cordless 2-in-1 Vacuum with Motorized Pet No Check Price
3. Lightweight Cordless Stick Vacuum, 8-in-1 with 180° Bendable Wand for Home Floors…. Lightweight Cordless Stick Vacuum, 8-in-1 with 180° Bendable Wand for Check Price
4. Lightweight 40Kpa Cordless Stick Vacuum, 8-in-1 with Anti-Tangle for Floors and Pet Hair…. Lightweight 40Kpa Cordless Stick Vacuum, 8-in-1 with Anti-Tangle for F Check Price
5. Cordless Vacuum Cleaner, Upgraded 600W 50KPA 70Mins Cordless Stick Vacuum Cleaner with Self-Stand…… Cordless Vacuum Cleaner, Upgraded 600W 50KPA 70Mins Cordless Stick Vac Check Price

Our Top 5 Best Cheap Cordless Vacuum Reviews – Expert Tested & Recommended

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

🏆 Best Choice

1. Kenmore 16V Cordless Stick Vacuum – Lightweight 2-in-1 Handheld, LED Headlight for Pet Hair & Floors.

Kenmore 16V Cordless Stick Vacuum - Lightweight 2-in-1 Handheld, LED H

The Kenmore 16V Cordless Stick Vacuum is a fantastic entry-level option for anyone seeking a versatile and lightweight cleaning solution without a hefty price tag. This 2-in-1 stick vacuum and handheld cleaner is designed to tackle pet hair and daily messes on both carpets and bare floors, making it a highly adaptable choice for various home environments. Its cordless design ensures you can move freely from room to room, reaching every nook and cranny with ease.

Key Features That Stand Out

  • Lightweight 2-in-1 Design: Easily converts from a stick vacuum to a handheld for ultimate versatility.
  • 16V Cordless Operation: Provides freedom of movement without being tethered to an outlet.
  • LED Headlight: Illuminates hidden dust and debris, especially useful for pet hair on hard-to-see surfaces.
  • Up to 30 Minutes Run Time: Offers sufficient cleaning time for small to medium areas on low mode.
  • Two Speed Settings: Allows you to adjust suction power based on your cleaning needs.

Why We Recommend It

We recommend the Kenmore 16V for its impressive balance of portability, functionality, and affordability. It’s particularly effective for pet owners, thanks to its specialized design for tackling pet hair. The detachable handheld unit is a game-changer for quick spot cleans, car interiors, or upholstery. If you’re looking for an efficient and easy-to-use cheap cordless vacuum for everyday tasks, this Kenmore model is a strong contender.

Best For

This vacuum is ideal for apartment dwellers, small homes, or as a secondary vacuum for quick daily cleanups and homes with light to moderate pet hair shedding. Its lightweight nature also makes it great for seniors or anyone who finds heavier vacuums challenging.

Pros and Cons

Pros:
  • Lightweight and easy to maneuver.
  • Versatile 2-in-1 stick and handheld design.
  • Effective at picking up pet hair on various surfaces.
  • LED headlight improves visibility of dirt.
Cons:
  • 30-minute run time is on low mode, higher suction reduces battery life.
  • 16V power might be less robust for deeply embedded dirt in thick carpets.

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: “I’ve owned this vacuum for a little over a year now, and use it every day, sometimes multiple times per day. We keep it in the kitchen and use it to clean up crumbs, messes, and dirt that gets tracked in from outside. It does a great job on hard floors and picks up everything from small debris to fi”

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

⭐ Editor’s Choice

2. Electrolux Ergorapido Pet Cordless 2-in-1 Vacuum with Motorized Pet Nozzle, 48-Minute Run Time.

Electrolux Ergorapido Pet Cordless 2-in-1 Vacuum with Motorized Pet No

For pet owners seeking a reliable and efficient cleaning solution, the Electrolux Ergorapido Pet Cordless 2-in-1 Vacuum is a standout. This vacuum is specifically engineered to tackle stubborn pet hair, combining powerful suction with smart design features. Its impressive run time means you can cover more ground without interruption, making daily pet hair management much easier and less time-consuming. It’s a compelling option among cheap cordless vacuums for homes with furry friends.

See also  10 Best Hand Blenders: Expert Picks for Flawless Blending

Key Features That Stand Out

  • Motorized Pet Nozzle: Effectively lifts and removes pet hair from various surfaces, including upholstery.
  • 48-Minute Run Time: Provides extended cleaning sessions on a single charge.
  • 180° EasySteer Maneuverability: Glides effortlessly around furniture and obstacles.
  • Bright LED Nozzle Lights: Enhances visibility of dirt and pet hair in dimly lit areas.
  • Detachable 2-in-1 Hand Unit: Perfect for spot cleaning, car interiors, and above-floor surfaces.

Why We Recommend It

The Electrolux Ergorapido Pet is a top recommendation for anyone dealing with pet hair, offering specialized tools and a long-lasting battery. Its excellent maneuverability and LED lights ensure no mess is left behind, even in tight spaces. The convenience of its 2-in-1 design means you get both a powerful floor cleaner and a handy spot vacuum, making it a truly versatile and efficient addition to your cleaning arsenal.

Best For

This vacuum is perfectly suited for homes with pets, especially those with multiple animals or frequent shedding. It’s also great for quick daily cleanups and reaching awkward areas, thanks to its handheld mode and easy steering.

Pros and Cons

Pros:
  • Exceptional at removing pet hair with its specialized nozzle.
  • Long 48-minute run time is great for larger areas.
  • Superior maneuverability with 180° EasySteer technology.
  • LED lights highlight hidden dirt effectively.
Cons:
  • Battery life might be shorter on higher power settings.
  • While excellent for pet hair, it might be slightly overkill if you don’t have pets.

Customer Reviews

Customer Review: “Years ago I purchased the blue version of this vacuum to use at my Lake House. Liked it so much that I own 3 of them, one for each floor of the house for quick cleanups without running up and down stairs. I had one in my kitchen at my regular house. It needed replacing, because, as mentioned, I bou”

Customer Review: “This Electrolux battery powered sweeper is great! It is lightweight, easy to handle, reaches under most furniture. I haven’t timed the battery, but may not last as long as stated. But, it is long enough to vacuum my first floor of five rooms. It has two power settings. I use the higher one for woo”

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

💰 Best Budget

3. Lightweight Cordless Stick Vacuum, 8-in-1 with 180° Bendable Wand for Home Floors.

Lightweight Cordless Stick Vacuum, 8-in-1 with 180° Bendable Wand for

If you’re on a tight budget but still desire the convenience of a cordless vacuum, this Lightweight Cordless Stick Vacuum with an 8-in-1 design and a 180° Bendable Wand is an excellent choice. It offers remarkable versatility and user-friendly features that are typically found in more expensive models. This vacuum proves that you don’t have to sacrifice functionality for affordability, making it a true contender for the best cheap cordless vacuum.

Key Features That Stand Out

  • 8-in-1 Versatility: Transforms with various attachments to clean floors, ceilings, and everything in between.
  • 180° Bendable Wand: Reaches under low furniture without needing to bend or stoop, enhancing comfort.
  • Self-Standing Design: Conveniently parks itself upright for easy storage and quick breaks during cleaning.
  • Strong 180W Motor: Delivers powerful suction for effective cleaning on hard floors and low-pile carpets.
  • Lightweight Construction: Easy to carry and maneuver around the home, reducing cleaning fatigue.

Why We Recommend It

This vacuum punches above its weight class in terms of features for its price. The bendable wand is a fantastic innovation for those hard-to-reach areas, while the self-standing feature adds a level of convenience usually reserved for premium models. It’s a versatile, easy-to-use, and highly affordable option for everyday home cleaning, especially if you have a mix of hard floors and low-pile carpets.

Best For

This vacuum is perfect for individuals or families on a budget, those with apartments or smaller homes, and anyone who values ergonomic design (like the bendable wand) for comfortable cleaning. It’s also great as a secondary vacuum for quick tasks.

Pros and Cons

Pros:
  • Extremely budget-friendly with premium features.
  • Flexible 180° bendable wand improves reach under furniture.
  • Convenient self-standing design for storage and pauses.
  • Versatile 8-in-1 functionality with various attachments.
Cons:
  • 180W motor may struggle with very thick carpets or deeply embedded dirt.
  • Requires using the original adapter for optimal charging, as specified.

Customer Reviews

Customer Review: “I bought this vacuum for our apartment and it’s been a great upgrade. Before this, we used a small handheld vacuum that forced me to bend down all the time, which was really inconvenient at my age, so being able to clean while standing is a huge relief. It’s lightweight, cordless, and easy to move a”

Customer Review: “Nice design, affordable, working great.I have been checking on the Dyson hand held vaccum for long time, but the cost is out of my budget. While searching around for early black friday sale, I saw this vaccum and was attracted with thi one. First the design and color are very close to Dyson, the pri”

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

4. Lightweight 40Kpa Cordless Stick Vacuum, 8-in-1 with Anti-Tangle for Floors and Pet Hair.

Lightweight 40Kpa Cordless Stick Vacuum, 8-in-1 with Anti-Tangle for F

The Lightweight 40Kpa Cordless Stick Vacuum is a powerful contender in the world of cheap cordless vacuums, especially for those battling pet hair and general household dust. Boasting an upgraded motor and an innovative anti-tangle design, this 8-in-1 vacuum is engineered to provide robust suction without the common frustrations of hair wrapping around the brush. It’s a strong, versatile option for maintaining clean floors and surfaces.

See also  7 Best Home Vacuum Cleaners: Expert-Approved for Superior Clean

Key Features That Stand Out

  • Upgraded 40Kpa Suction (2025 Model): Delivers impressive cleaning power for its price point.
  • 8-in-1 Versatility: Comes with multiple attachments for comprehensive cleaning tasks.
  • Anti-Tangle Brush Design: Prevents hair from wrapping around the brush roll, maintaining cleaning efficiency.
  • Two Adjustable Power Modes: Allows you to switch between standard cleaning and maximum power for stubborn messes.
  • 6*2200mAh Rechargeable Batteries: Offers a decent run time for quick cleanups, typically 15-20 minutes on max power.

Why We Recommend It

We’re impressed by the sheer suction power this vacuum offers, which is a rare find in the budget category. The anti-tangle feature is a huge plus for pet owners, saving time and effort on maintenance. Its versatility means you can easily switch from cleaning floors to reaching high corners or even vacuuming your car. This model offers a lot of bang for your buck.

Best For

This vacuum is ideal for homes with pets, small to medium-sized apartments, and anyone who needs a powerful yet affordable cordless vacuum that can handle various cleaning scenarios with ease.

Pros and Cons

Pros:
  • Very strong 40Kpa suction power for thorough cleaning.
  • Anti-tangle brush is highly effective for pet hair and long human hair.
  • Versatile 8-in-1 design with multiple cleaning tools.
  • Lightweight and easy to handle for daily use.
Cons:
  • Battery run time (15-20 mins on max power) might be short for larger homes.
  • Requires a specific original adapter for charging to prevent issues.

Customer Reviews

Customer Review: “To begin, I have 3 dogs and 1 cat. One of my dogs has always been bothered by the vacuum noise, light, and the mere sight of it. He is also super sensitive and has super senses! So, I usually get barked at and he gets very nervous and is so uncomfortable. I had to pick and choose when I could vacuum”

Customer Review: “This vacuum cleaner has strong suction power which can absorb tiny pieces of dust from the corners. I use it mostly for hard floor and it works well even on low carpet. Once charged the battery lasts about 30 mins. With 2 in 1 brush, it’s really helpful to vacuum inside the car as well. It’s very li”

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

5. Cordless Vacuum Cleaner, Upgraded 600W 50KPA 70Mins Cordless Stick Vacuum Cleaner with Self-Stand…

Cordless Vacuum Cleaner, Upgraded 600W 50KPA 70Mins Cordless Stick Vac

Prepare to be amazed by the Upgraded 600W 50KPA 70Mins Cordless Stick Vacuum Cleaner, a true powerhouse that redefines expectations for a cheap cordless vacuum. This model stands out with its incredibly powerful suction and an extended run time, rivalling much more expensive brands. It’s designed to deliver a deep and thorough clean across all floor types, ensuring your home remains immaculate without constant recharging.

Key Features That Stand Out

  • 50,000Pa Powerful Suction: Equipped with an upgraded 600W brushless motor for unparalleled cleaning power.
  • Max 70 Mins Running Time: Features an 8*2800mAh rechargeable battery pack for extensive cleaning sessions.
  • V-shaped Anti-winding Brush: Innovatively designed to prevent hair entanglement, ensuring consistent performance.
  • Self-Stand Functionality: Allows the vacuum to stand upright on its own, offering convenience during breaks and for storage.
  • Multi-surface Cleaning: Effective on various floor types, from hard floors to carpets.

Why We Recommend It

This vacuum is a game-changer for its price point. The combination of an astonishing 50,000Pa suction power and an industry-leading 70-minute battery life makes it an unbeatable choice for comprehensive cleaning. The V-shaped brush addresses a common pain point for many users, and the self-stand feature just adds to its overall usability. If you want maximum performance without the premium cost, this is your go-to.

Best For

Ideal for larger homes, individuals who need extended cleaning time, and those with a mix of floor types and high traffic. It’s also excellent for households with pets due to its powerful suction and anti-winding brush.

Pros and Cons

Pros:
  • Incredibly strong 50,000Pa suction for deep cleaning.
  • Exceptional 70-minute run time, suitable for larger homes.
  • Advanced V-shaped anti-winding brush handles hair effortlessly.
  • Convenient self-standing feature for ease of use and storage.
Cons:
  • Can feel a bit top-heavy due to the powerful motor and large battery.
  • Charging time for such a large battery capacity might be longer.

Customer Reviews

Customer Review: “I bought this vacuum cleaner because it’s ideal for cleaning all types of floors. It has excellent suction, and its power allows for deep cleaning, especially on carpets and my dog’s hair. It leaves nothing behind; it picks up all the dirt. Plus, the charge lasts a very long time, making it ideal fo”

Customer Review: “Easy to put together. Came boxed well. It can get into tight spots. Vacuumed with it after having the family over for thanksgiving and worked great. It is a bit top heavy but for the price point, I can’t complain. It’s a good vacuum and good quality. Easy to empty the dustbin. Worked well on my lvp,”

Complete Buying Guide for Best Cheap Cordless Vacuum

Essential Factors We Consider

When searching for the best cheap cordless vacuum, it’s easy to get overwhelmed by the options. To help you make an informed decision, we focused on several key factors that truly impact performance and value. First and foremost is suction power, often measured in kPa or Watts; a higher number generally means better dirt pickup. Next, we look at battery life and run time – how long can the vacuum clean on a single charge, and how long does it take to recharge? Weight and maneuverability are crucial for comfort and ease of use, especially for prolonged cleaning. We also consider the filtration system, which affects air quality, and the dustbin capacity, as nobody wants to empty it constantly. Finally, the vacuum’s versatility, including different attachments and 2-in-1 functions, adds significant value, allowing it to tackle various cleaning tasks efficiently.

See also  10 Best Personal Blenders: Expert Picks & Reviews

Budget Planning

Finding a truly great cheap cordless vacuum means understanding where to make smart trade-offs. While you might not get all the bells and whistles of a premium model, focusing your budget on the features most important to your needs is key. For example, if you have pets, prioritizing strong suction and an anti-tangle brush is a wise move, even if it means a slightly shorter battery life. If you have a smaller apartment, a basic model with decent run time might be all you need, allowing you to save even more. Remember, a higher price doesn’t always guarantee better performance, especially in the rapidly improving budget vacuum market. Look for sales, read reviews, and compare specifications to ensure you’re getting the most powerful suction and reliable battery life within your price range.

Final Thoughts

Ultimately, the best cheap cordless vacuum is one that fits your lifestyle and cleaning habits perfectly. Don’t be swayed by marketing jargon; instead, focus on the practical features that will genuinely make your life easier. Consider the size of your home, the types of floors you have, whether you have pets, and how often you’ll be using the vacuum. By carefully evaluating these aspects against the performance and features of our recommended models, you’ll be able to choose a reliable and effective cleaning tool that keeps your home sparkling without straining your wallet.

Frequently Asked Questions

Q: How long do cheap cordless vacuum batteries typically last?

A: The battery life of cheap cordless vacuums can vary significantly, usually ranging from 15 minutes on max power to about 40-70 minutes on lower power settings. Factors like the battery’s voltage (e.g., 16V vs. 22V), milliamp-hour (mAh) rating, and the vacuum’s motor efficiency all play a role. Always check the specifications for typical run times on different power modes.

Q: Are cheap cordless vacuums good for pet hair?

A: Many cheap cordless vacuums are surprisingly effective at tackling pet hair, especially those that come with specialized motorized pet nozzles or anti-tangle brush designs. Models with higher suction power (like those above 30KPa) and strong brush rolls tend to perform best on both hard floors and low-pile carpets. Always look for specific mentions of “pet hair” in the product description.

Q: Can I use a cheap cordless vacuum on all floor types?

A: Most modern cheap cordless vacuums are designed for multi-surface cleaning, performing well on hard floors (wood, tile, laminate) and low-pile carpets or rugs. However, some might struggle with deep-pile carpets or very thick rugs. Always check if the vacuum has multiple power modes or a brush roll that can be turned off for delicate hard floors.

Q: What’s the difference between kPa and W in suction power?

A: kPa (kilopascals) measures the static pressure, indicating how much suction the vacuum can generate, which is good for lifting debris. W (Watts) typically refers to the motor’s power consumption. While a higher wattage motor often means greater suction, kPa is a more direct measure of the actual suction strength. When comparing, prioritize kPa for actual cleaning power, and understand that higher watts usually imply higher suction and potentially more energy use.

Q: How to maintain a cheap cordless vacuum to extend its life?

A: Regular maintenance is key for any vacuum, especially budget models. Routinely empty the dustbin after each use, clean or replace filters as recommended by the manufacturer, and check the brush roll for tangled hair or debris. Make sure to use the original charger to prevent battery damage. Proper maintenance ensures consistent performance and extends the lifespan of your cheap cordless vacuum.

There you have it – our top picks for the best cheap cordless vacuum models that truly deliver on their promise of convenient and effective cleaning without the premium price tag. We understand that finding an affordable option that doesn’t compromise on performance can be tricky, but these selections prove it’s entirely possible. Each vacuum highlighted offers a unique set of features tailored to different needs, from superior pet hair removal to impressive suction power and extended battery life.

Whether you’re battling daily pet hair, navigating a small apartment, or simply want the freedom of a cordless clean, there’s a budget-friendly option here for you. Don’t let a tight budget stop you from enjoying a cleaner, more convenient home. Take a closer look at our recommendations, compare their features, and click the “Check Price on Amazon” buttons to find the perfect cheap cordless vacuum that will make your cleaning routine a breeze!

// Fetch real-time product data for all products when page loads
(function() {
const products = [‘B0CKX1DZD6’, ‘B08VXCK86C’, ‘B0FR2FN4K5’, ‘B0FQ2Z2WS9’, ‘B0F1N21NKM’];
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