Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM: Advice on building a shopping basket

date posted 11th May 2006 21:41

Slightly different approach here:

Registered users log on and have a basket in the database.
Unregistered users use a session array as a basket.

If a user adds items to the basket, then registers or logs on, the items
are copied to the database. This means that registered users can keep
the contents of their cart, whilst unregistered ones lose them once the
browser closes.

It also means that no-one is forced to register in order to buy.

Lee.


Andy Macnaughton-Jones wrote:
> This is what we do;
>
> Basket table with user_id and guid_id. Guid ID is generated per session.
>
> (1) new user adds stuff to shopping basket. On addition of first new
> item, system creates a new basket and assigns to users GUID (randomly
> generated id)
>
> (2) user then goes to check out, system requests them register which
> creates a userid
>
> (3) system then assigns user_id to the newly created basket and the
> user_id is then used throughout.
>
>
> (4) User comes back again for another shopping trip...
>
> (5) again, new basket gets created that has a new guid
>
> (6) user then logs on, system knows that there was a previous basket so
> puts all the new stuff into the old basket and assigns that.
>
> So essentially an unknown user has a temporary basket, a known user has
> their own personal basket and any new stuff gets put into that once the
> system knows who they are.
>
> Cheers
> Andy
>
>
>
>
> -----Original Message-----
> From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of Andy
> Macnaughton-Jones
> Sent: 11 May 2006 19:00
> To: Andy Macnaughton-Jones
> Subject: RE: FN-FORUM: Advice on building a shopping basket
>
>
> We do this for our e-commerce - will drop you a line later if you still
> need to know.
>
> -----Original Message-----
> From: [EMAIL REMOVED] [EMAIL REMOVED] On Behalf Of D D
> Glendinning
> Sent: Thursday, May 11, 2006 9:25 AM
> To: Andy Macnaughton-Jones
> Subject: FN-FORUM: Advice on building a shopping basket
>
>
> Good Morning All,
>
> Right, I have been building this shopping basket for an online shop. I
> had designed it so that the visitor needs to register and log in before
> they may add items to the basket. When they are added, it checks for an
> "Open" basket, and if there is one, adds the item to it (Order_Item
> table), or else it creates a new empty shopping basket, tagged with the
> user's ID.
> This works really well, and has the added advantage that if they add
> items to the basket, and then log out, the items are there for them to
> continue with when they log back in.
>
> The issue I now have is allowing non registered visitors to add items,
> and then register at the checkout stage, rather than before. I have a
> few ideas, such as creating a random session ID key, and using that
> instead of the userID, and when they register, changing the random
> session ID to the newly created UserID... But not sure.
>
> No point in re-inventing the wheel if there is a standard practice for
> this, so look forward to hearing from you with your thoughts!
>
> Many Thanks,
>
> Duncan
>
> --
> Duncan Glendinning
> M: 07944797010
> W: www.spider-consultancy.co.uk
>
> --
> Freelancers, contractors earn more with Prosperity4 Call 0870 870 4414
> or visit www.prosperity4.com and benefit from Inland Revenue approved
> expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>
> --
> Freelancers, contractors earn more with Prosperity4 Call 0870 870 4414
> or visit www.prosperity4.com and benefit from Inland Revenue approved
> expenses today.
>
> To advertise here: http://www.freelancers.net/advertising.html
>
>
>



Messages by Day
May 31st 2006
May 30th 2006
May 29th 2006
May 28th 2006
May 27th 2006
May 26th 2006
May 25th 2006
May 24th 2006
May 23rd 2006
May 22nd 2006
May 21st 2006
May 20th 2006
May 19th 2006
May 18th 2006
May 17th 2006
May 16th 2006
May 15th 2006
May 14th 2006
May 13th 2006
May 12th 2006
May 11th 2006
May 10th 2006
May 9th 2006
May 8th 2006
May 7th 2006
May 6th 2006
May 5th 2006
May 4th 2006
May 3rd 2006
May 2nd 2006
May 1st 2006


Messages by Month
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000