Appendix B:  Customization

In this section:


Appendix B:  EDatCat Functions

Like the Shortcuts, EDatCat "Functions" can be used within your templates to create a custom and convenient shopping environment.  The benefit to you, the developer, is that the Shortcuts and Functions reduce the time it takes you to create such an environment.

However, unilke the Shortcuts, which can only be used within the EDatCat templates, Functions can be used anywhere- whether it be a dynamically generated page or a static page on another web site.

Understanding Functions

EDatCat interprets the Functions as commands.  In other words, you link to the program and tell it what to do.  You tell EDatCat that it is about to receive a function by providing it with "user_action=".

A function can be used in a hyperlink as follows:

%%script_loc%%?user_action=addtocart& catalogno=%%catalogno%%
Notice that "addtocart" is a function.  In this link, you are telling EDatCat to add an item to the shopping cart.  This link would be used on an EDatCat dynamically-generated page and the Shortcut %%catalogno%% would the catalog number of the item you wish to add.

Another example of a function used in a hyperlink is:

http://www.yourdomain.com/cgi-bin/mystore.pl?user_action=addtocart&catalogno=ITEM01
This link could be on another web site linking back to your store.  This link would be on a static page and is providing EDatCat with all of the information it needs to add your item to the shopping cart.

Functions can also be used as hidden fields in a form.  For example:

<form method="post" action="%%script_loc%%">
<input type="hidden" name="user_action" value="login">
Again, this form uses Shortcuts, so it would be placed within an EDatCat template.  If this form were on a static page, you would need to hard-code the path to the script in the form action.

In this instance, the Function "login" is used to tell EDatCat that the information submitted in this form should be used to log the user in.  Of course, in this form, the text fields for the user's email address and password would be provided.

Click here a printable list and description of EDatCat functions.

Functions allow you to create a strong measure of convenience for your customers.  By using Shortcuts and Functions throughout the templates and the rest of your site, a truly interactive and easy shopping process is accomplished.

 

NEXT-  Part Four: Various Notes and Resources