NOTE! See the ReadMe.txt file in the store folder you uploaded. Some of the files in that folder contain code snippets you may use or cfinclude into your own template.
These are some various links, variables, etc., that you may find useful in integrating cf_cart into your website. Please keep an eye out for updates to this page. We will be more adding tips and tricks.
Please be aware that many links here (as shown) will require that the cartpage and securepage variables be set on the page where the links are called. Please see the "cartpage" section.
Keeping the shopping cart session alive if the user has cookies disabled.
All pages must be .cfm pages. Every link must end in one of two variables.
If you are running on ColdFusion MX and using J2EE session variables, there is another variable that you must add if you wish to run without cookies. This is if your host is using J2EE session variables as opposed to ColdFusion session variables. You should ask them.
Redirection after placing an item into the cart.
Two variables available:
<cfset autoupdatelink = "">
ColdFusion CFLOCATION "bug" workaround.
With ColdFusion 5.0 running IIS on the server side, occasionally after a redirection using cflocation, header information will appear at the top of the web page.
This has sometimes appeared running IE6 under Windows XP on the client side. We have 2 variables available. Set either one of these at the top of the cartpage template.
Hide number of products found message at top of product lisiting.
There is a message showing the number of items found above the product list after browsing or searching. Some people
only have several items and always show them all when browsing. To hide the X Items Found message, set the following variable.
Show the shopping cart total.
The cart total is held in a variable called "client.total".
Set the following variable code where you wish to show the total.
You may use a CFIF statement if you wish, something to the effect of:
<CFIF client.total GT "0">
Your Total: <CFOUTPUT>#LSCurrencyFormat(client.total)#</CFOUTPUT>
<CFELSE>
Your Shopping Cart Is Empty
</CFIF>
Show a "View Cart" link.
Just paste the link below into any or all of your ColdFusion templates. You may also use it
on the code above if you like. We often set the dollar amount as the link to the cart.
Show a "Checkout" link.
There will always be a checkout link from the Shopping Cart page. If you would also like to place a link to checkout
from your templates, add the code below. Note that you may check that their are items in the basket before showing a checkout link.
<CFIF client.total GT "0">
<a href="<CFOUTPUT>#ezcartcheckout#</CFOUTPUT>">Checkout</a>
</CFIF>
If for any reason you will ever have any items that are free, you may change client.total to client.realquantity.
Change "Continue Shopping" Destination
By default, whenever we click the Continue Shopping button, we pass a "page" value of "list.cfm" to return to the product listing. You may change this. For example, you may be using the cf_specials tag and loading it when passing a page value of "specials". The cf_specials tag sends an "action" value of "showspecials". When someone clicks on a Special item you may not want to send them back to that individual item since they're probably not going to order it again. Adding the code below would cause them to return to the page showing all the specials when clicking on Continue Shopping.
<CFIF action IS "showspecials"><cfset returnpage = "specials"></CFIF>
May also be used with the returntoproducts variable to automatically return them to the last shopping page.
Simple Order Link
Pass a single variable to allow ordering. May be used with the integration method or with the standalone version.
Pass a variable named orderitem with the value being one or more Product IDs in a comma delimited list. This may be a form or url variable. You may also pass a matching orderqty variable with the quantity of each item. If this is not passed or is a different length than the orderitem variable, one of each will be placed in the cart.
Examples:
To use the standalone cart with this, just pass the variables directly to ezcart/cart.cfm.
Hide Search Button
Place this variable at the top of the cartpage template:
<cfset hidesearch = "1">