From df512dea122ea493de82997ae2617cfc012770db Mon Sep 17 00:00:00 2001 From: Divlo Date: Tue, 28 Apr 2020 18:06:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20rightPrice=20est=20conver?= =?UTF-8?q?tit=20en=20Number?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/assets/functions/main/rightPrice.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/assets/functions/main/rightPrice.js b/api/assets/functions/main/rightPrice.js index 687ab11..ac557ae 100644 --- a/api/assets/functions/main/rightPrice.js +++ b/api/assets/functions/main/rightPrice.js @@ -26,11 +26,12 @@ async function getAmazonProductList(url) { for (let indexProduct in amazonProductList) { try { const elementProduct = amazonProductList[indexProduct]; - const productImage = elementProduct.querySelector('.s-image'); + const productImage = elementProduct.querySelector('.s-image'); + const originalPrice = elementProduct.querySelector(".a-price-whole").innerHTML; productsList.push({ name: productImage["alt"], image: productImage["src"], - price: elementProduct.querySelector(".a-price-whole").innerHTML + price: Number(originalPrice.replace(",", ".").replace(" ", "")) }); } catch (error) { continue;