Skip to content

Commit

Permalink
fix breadcrumbs product page
Browse files Browse the repository at this point in the history
  • Loading branch information
dahltina committed May 28, 2021
1 parent 15f16c3 commit bcf007b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion js/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const productContainer = document.querySelector(".container-jacket");
const breadcrumb = document.querySelector(".breadcrumb");
const pageTitle = document.querySelector("title");
const prevPage = document.referrer;

const queryString = document.location.search;
const params = new URLSearchParams(queryString);
Expand All @@ -23,7 +24,7 @@ async function getProduct() {
pageTitle.innerHTML += `${results.name}`;

breadcrumb.innerHTML += `<a href="index.html" class="breadcrumb">Home ></a>
<a href="mens.html" class="breadcrumb"> Mens ></a> <b>${results.name}</b>`
<a href="${prevPage}" class="breadcrumb"> ${results.categories[0].name} ></a> <b>${results.name}</b>`

productContainer.innerHTML += `<div class="box-2">
<img class="medium-square" src="${results.images[0].src}" alt="${results.name}">
Expand Down
2 changes: 0 additions & 2 deletions product.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ <h3>Reviews</h3>
</form>
</section>
</footer>

<script src="js/product.js"></script>
<script src="js/script.js"></script>
</body>
</html>

0 comments on commit bcf007b

Please sign in to comment.