Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug panier #18

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions JS/articles.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,153 +2,153 @@ let reponse = [
{
_id: "a001",
nomProduit: "Super Nintendo Classic",
prix: 80,
prix: 8000,
},
{
_id: "a002",
nomProduit: "Nintendo 64",
prix: 500,
prix: 50000,
},
{
_id: "a003",
nomProduit: "Nintendo GameCube",
prix: 500,
prix: 50000,
},
{
_id: "a004",
nomProduit: "Nintendo DS",
prix: 500,
prix: 50000,
},
{
_id: "a005",
nomProduit: "Nintendo Wii",
prix: 500,
prix: 50000,
},
{
_id: "a006",
nomProduit: "Nintendo 3DS",
prix: 500,
prix: 50000,
},
{
_id: "a007",
nomProduit: "Nintendo Wii U",
prix: 500,
prix: 50000,
},
{
_id: "a008",
nomProduit: "Nintendo Switch",
prix: 500,
prix: 50000,
},
{
_id: "b001",
nomProduit: "PlayStation 1",
prix: 50,
prix: 5000,
},

{
_id: "b002",
nomProduit: "PlayStation 2",
prix: 50,
prix: 5000,
},
{
_id: "b003",
nomProduit: "PlayStation 3",
prix: 50,
prix: 5000,
},
{
_id: "b004",
nomProduit: "PlayStation 4",
prix: 50,
prix: 5000,
},
{
_id: "b005",
nomProduit: "PlayStation 5",
prix: 50,
prix: 5000,
},
{
_id: "b006",
nomProduit: "PS Vita",
prix: 50,
prix: 5000,
},
{
_id: "b007",
nomProduit: "PSP",
prix: 50,
prix: 5000,
},
{
_id: "b008",
nomProduit: "PlayStation VR",
prix: 50,
prix: 5000,
},
{
_id: "c001",
nomProduit: "Xbox 360",
prix: 25,
prix: 2500,
},
{
_id: "c002",
nomProduit: "Xbox one",
prix: 25,
prix: 2500,
},
{
_id: "c003",
nomProduit: "Xbox one x",
prix: 25,
prix: 2500,
},
{
_id: "c004",
nomProduit: "Xbox series s",
prix: 25,
prix: 2500,
},
{
_id: "c005",
nomProduit: "xbox series x",
prix: 25,
prix: 2500,
},
{
_id: "c006",
nomProduit: "manette xbox series x et s",
prix: 25,
prix: 2500,
},
{
_id: "c007",
nomProduit: "manette xbox elite",
prix: 25,
prix: 2500,
},
{
_id: "c008",
nomProduit: "casque xbox",
prix: 25,
prix: 2500,
},
{
_id: "d001",
nomProduit: "Clavier",
prix: 90,
prix: 9000,
},
{
_id: "d002",
nomProduit: "Enceinte Gaming",
prix: 90,
prix: 9000,
},
{
_id: "d003",
nomProduit: "Fauteuil Gaming",
prix: 90,
prix: 9000,
},
{
_id: "d004",
nomProduit: "Casque Gaming",
prix: 90,
prix: 9000,
},
{
_id: "d005",
nomProduit: "Souris Gaming",
prix: 90,
prix: 9000,
},
{
_id: "d006",
nomProduit: "Tapis de souris Gaming",
prix: 90,
prix: 9000,
},
{
_id: "d007",
Expand Down
6 changes: 0 additions & 6 deletions JS/envoi_panier.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,7 @@ const idProduitSelectionner = reponse.find((element) => element._id === id);

const btn_envoyerPanier = document.querySelectorAll("#btn-envoyer");

btn_envoyerPanier.forEach((button) => {
button.addEventListener("click", () => {
let newUrl = button.attributes["0"].nodeValue;

window.location.href = newUrl;
});
});

btn_envoyerPanier.forEach((button) => {
button.addEventListener("click", () => {
Expand Down
3 changes: 3 additions & 0 deletions html/bureau gaming.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/casque gaming.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/casque xbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/clavier.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/enceinte gaming.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/fauteuil gaming.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/manette xbox elite.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/manette xbox series x et s.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo 3ds.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo 64.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo ds.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo gamecube.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo switch.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo wii u.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo wii.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/nintendo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nintendo</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
5 changes: 4 additions & 1 deletion html/panier.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Panier</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand All @@ -21,7 +24,7 @@ <h1>Site E-commerce pour consoles vidéo</h1>
</nav>
<main>
<section id="basket" class="flex-column-centre">
<div id="blocTitrePanier" class="flex-start size80">
<div id="container-produits-panier" class="flex-start size80">

</div>
<div id="basket-items" class="flex-column-center">
Expand Down
3 changes: 3 additions & 0 deletions html/pc.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PC</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
3 changes: 3 additions & 0 deletions html/playstation 1.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PlayStation</title>
<link rel="stylesheet" href="../css/style.css" />
<script src="../JS/articles.js" defer></script>
<script src="../JS/envoi_panier.js" defer></script>
<script src="../JS/panier.js" defer></script>
</head>
<body>
<header>
Expand Down
Loading
Loading