Render data from Json file with innerHTML

This code is a part of a webshop. When I check the console, it returns allItems and also the qsArticle that I want to render with innerHTML but I know I’m missing something but don’t really understand what it is. Here is my code:

const queryString = new URLSearchParams(;
const qsArticles = queryString.get(‘article’);
const productContainer = document.querySelector(’.product-info’);

let products = ; // Array to store the data in products.json
let allItems = ; // Array to store products that are copied ^

const getArticles = async () => {
const response = await fetch(’…/products.json’);
const data = await response.json();
products = […data.products];

  allItems.forEach(item => {
        if( === qsArticles) {
              productContainer.innerHTML +=
        `<articel class="product-article "id=article-${}>
              <div class="article-content-wrapper">
              <div class="article-left-wrapper">
              <a href="../product/product.html?article=${}"><img class="product-img" src=${item.image}></img></a>
              <div class="article-right-wrapper">
              <p>Description: ${item.description}<p/>
              <p>Price: ${item.price}<p/>
              <button class="add-to-cart" id="addbtn-${}">Köp</button>

  products.forEach(product => {
        let items = product.items;
        items.forEach(item => {



This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.