Jump to content


Photo

Setting up a (fairly) simple shopping basket page


  • Please log in to reply
3 replies to this topic

#1 nickholt1972

nickholt1972
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts
  • LocationBury, Lancs, UK

Posted 29 September 2006 - 12:44 PM

I've got an online shop (at www.appletreenappies.co.uk/store.php if you're interested), currently all my products have a 'Buy' button which links to Paypal but I want to set up my own custom built shopping basket. I know i'll need to use session variables and arrays but beyond that i'm worryingly clueless.

I know how to pass Product IDs from one page to another but I don't know how to pop the little buggers into an array which would list the items purchased and calculate quantities and total prices.

Can anyone give me some guidance on this please?

Thanks,
Nick.


Nick Holt - Future Guru

#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 29 September 2006 - 01:12 PM

Off Topic: I checked out your page in Firefox, and oh dear!....  :o

I'm guessing you're using layers as I navigated to this page....
http://www.appletree...oduct=multisize

I can't see any of the product descriptions as they're obscured by the size/colour/fastening box :(

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 steveclondon

steveclondon
  • Members
  • PipPipPip
  • Advanced Member
  • 161 posts

Posted 29 September 2006 - 01:22 PM

Yea i use firefox as well and see what he means. It is worth downloading firefox and opera and testing your site when making it, also ie 7 is comming out soon and it is something else to think about.

Oh and how to do this. Have a temporary table in mysql that has user id and item in it and session. As the user adds items they are put in here and can be pulled. When an order is placed it will be moved from the temp table to the order table deleting the temp table(not the table just the data for that user and session). It is a good idea to have the date field in the temp table so that you can auto delete any data left in there when people add stuff and don't check out.

Each item could just be a get id and you would have the user a $_SESSION id. Then a page that handles collecting the $_GET['productid'] and adds it to the temp table.

Hope this helps

#4 nickholt1972

nickholt1972
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts
  • LocationBury, Lancs, UK

Posted 02 October 2006 - 07:46 PM

HuggieBear, steveclondon,

Guys, I really appreciated your comments re the site. I downloaded a few alternative browsers today including Firefox and i've made a few ammendments.

http://www.appletree...oduct=multisize

Please have a look and see if you can spot the difference. BTW I was using lots of DIVs, not layers but now i've popped all the product descriptions in tables. It still needs a bit of tweaking but its an improvement.

So thanks for your input.
Nick Holt - Future Guru




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users