Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8994663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:28:58+00:00 2026-06-15T23:28:58+00:00

I have a shopping website and I am using javascript to add items to

  • 0

I have a shopping website and I am using javascript to add items to cart. Every time I click on add to cart, it puts the name of the item in a div that represents the cart. I would like to keep the content of the cart on each page, so what I did is:

$("#cartlink").attr("href", "cart.php?app="+tab+"")

Where “tab” is an array containing all the items in the cart. I then use a GET to retrieve the elements of the cart on the cart.php page. But my problem is since I add items in the cart using JS, if the user changes page without clicking on the cart.php?app link, tab will be erased and I have no way to recover “tab”. If the user clicks on the cart.php link, I can use a GET and store the content into a session and then use it on every page.

So I would need a way to memorize the cart content if the user decides not to click cart.php.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:29:00+00:00Added an answer on June 15, 2026 at 11:29 pm

    You can use localStorage to store the cart status in JavaScript, and submit it to the server when the user confirms the order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a shopping cart in a website and I have my items(which
I'm using the basic PayPal shopping cart (Website Payments Standard). I have the following
I have setup a shopping cart price rule of 10%. If I add a
I have a shopping cart website running classic ASP that needs help during the
I have a really simple e-commerce in my website. It's just a shopping cart,
I have implemented simple shopping cart in a website. I save the cart and
I'm making a shopping mall website using a Yahoo solution. I have multiple options
I'm building shopping mall website using Yahoo solution. My products have multiple options which
I have a PHP website and now the I want to add a shopping
I am implementing a shopping cart for my website, using a pseudo-AJAX Lightbox-esque effect.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.