On 10/31/01, Michael T. Tangorre penned:
>Hmmmm
>interesting.  How do you handle poeple with cookies disabled?
>Would it be better to focus on the higher percentage of people with cookies
>turned on?  I am not opposed to using a different method at all.. like I
>said I want to learn. Would it be better to have a table in the DB called
>Carts maybe that stored all the products and the cart ID??

Even if storing the items in the database, you will still need to 
keep track of the user.

I personally set a variable called variables.id in application.cfm.

<CFPARAM NAME="variables.id" DEFAULT="">

On every link throughout the site I append that variable.

href="somepage.cfm<cfoutput>#variables.id#</cfoutput>"

When the person places the first item in their cart I set a test 
cookie, set the variable to the cfid and cftoken and set 
client.rollcount to 1.


<cfif not isdefined('client.rollcount') and page is "cart.cfm">

<cfcookie name="testcookie" value="1" expires="1">
<cfset variables.id = "?cfid=#client.cfid#&cftoken=#client.cftoken#">
<cfset client.rollcount = 1>

<cfelse>

        <cfif isdefined('cookie.testcookie') and isdefined('client.rollcount')>
        <cfset variables.id = "">
        <cfelseif not isdefined('cookie.testcookie') and 
isdefined('client.rollcount')>
        <cfset variables.id = "?cfid=#client.cfid#&cftoken=#client.cftoken#">
        </cfif>

</cfif>

This way, search engines can follow all the links. page= is a 
variable I pass to all my different shopping cart templates. If the 
template is cart.cfm, then I set the query string. Search engine 
robots can't get to that page since it's a form submission.

I also (not to confuse you) set a variable called variables.idback 
which is the same as variables.id except it starts with a & instead 
of a ?. Then I use that on links where I need to pass a query string 
other than cfid and cftoken:

href="somepage.cfm?page=checkout.cfm<cfoutput>#variables.idback#</cfoutput>"
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to