To fix this issue E-commerce is a lot more complicated than you think. Even something as simple as a persistent shopping cart that allows your user to add a bunch of items takes a fairly significant amount of code. Then there is the whole checkout process and order tracking/fulfilment thing as well. Any true shopping cart is going to include shipping options, payment options, a cart of some sort, a check out process, order generation, etc. If you just want to sell a couple products then just use Paypal or Google Checkout.
To fix this issue 1) There won't be a pre built script 2) You can do it in php but you are going to have to take a look at how wp eCommerce stores it's data, depending on the database structure you may be able to filter data
help you fix your problem Assuming for beginners level. This tutorial could help you, It also teaches you the admin panel too for your cart. Or you can even use open source stuff like Oscommerce, magento.
Asp.Net Mvc shopping cart storing selected items in cart best approach
wish helps you There are two possible solutions. One is handled on client side and other on server side. I would recommend to go with sever side which is solution 2, so that even when user opens the cart later, they can still see the items they added in cart. Amazon gas similar behavior. Solution 1(client side): You can save the shopping cart details in localStorage or sessionStorage depends on your need and fetch the data from there when redirected to cart page