Skip to content

Commit

Permalink
Fixed bug of checkout due to session creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sudhanva21 committed Jul 17, 2024
1 parent 4ccb238 commit 7c4d456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/checkout_script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Retrieve the cart data from localStorage
const carts = JSON.parse(localStorage.getItem('cart')) || [];
const loggedInUser = sessionStorage.getItem('loggedInUser');
const user = JSON.parse(loggedInUser);
const carts = JSON.parse(sessionStorage.getItem(`cart_${user.username}`)) || [];
console.log(carts);
const listProducts = [
{
Expand Down

0 comments on commit 7c4d456

Please sign in to comment.