Skip to content
Snippets Groups Projects
Commit 6abfc7c8 authored by Gabriela Emma's avatar Gabriela Emma
Browse files

LN-471 added listings to php

parent 099969e7
No related branches found
No related tags found
1 merge request!7LN-471 added listings to php
Pipeline #3347 failed
import { items } from "./store/data.js";
for (let i = 0; i < items.length; i += 1) {
const store = document.createElement('div');
store.innerHTML = `
<a href="/store/details.php?id=${items[i].id}">
<img src="${items[i]?.img}" alt="" class="h-[400px] w-[100%]"/>
<div class="flex flex-row justify-between mt-4">
<div>
<h2 class="text-black/80 text-[20px] mb-2">
${items[i].name}
</h2>
<p class="text-[16px]">${items[i].price}</p>
</div>
<i class="fa-regular fa-heart text-[20px]"></i>
</div>
</a>
`;
document.querySelector('#store').appendChild(store);
}
export const items = [
{
id: 1,
name: "Macbook Pro 2016",
price: "995.5$",
img: "../images/mac.jpg"
},
{
id: 2,
name: "Shoes",
price: "35.2$",
img: "../images/shoes.jpeg"
},
{
id: 3,
name: "Handbag",
price: "60.1$",
img: "../images/bag.jpeg"
},
{
id: 4,
name: "Black Skirt",
price: "10.8$",
img: "../images/skirt.jpeg"
},
{
id: 5,
name: "Hoodie",
price: "5.5$",
img: "../images/hoodie.jpg"
},
{
id: 6,
name: "Product name 6",
price: "28.6$",
img: "../images/head.jpeg"
},
{
id: 7,
name: "IPhone",
price: "699$",
img: "../images/iphone.jpeg"
},
{
id: 8,
name: "Charger",
price: "19$",
img: "../images/charger.jpg"
},
];
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment