Customising Web Shopper
The following describes customisation of the "current" version of webshopper without full templating:
Basic Form
Customisation of the Webshopper is done through include files containing HTML fragments to be output with the generated HTML. These include files occur at specific points in the page and allow for very limited substitutions from session or form data.
Include files
Examining the HTML output from webshopper reveals the following include files commented:
- headerstuff.htmp
- This file is included as part of the page header. If this file does not include title, the company name is used. This file is allowed to close the header and begin the body tag, but it is recommended to put the body tag in bodystuff.htmp.
- bodystuff.htmp
- This file is included as the first thing following the body tag. It is allowed to include the body tag itself to set up things like page backgrounds.
- logostuff.htmp
- This file is included at the top of the page to allow customisation of corporate logo and placement of login messages.
- footerstuff.htmp
- This file is included at the end of any automatically generated HTML before closing the body tag.
Additionally, during checkout the following templates are checked for to provide further information on tendering. If these files do not exist, no informational page is displayed for that tender type.
- direct_deposit.htmp
- This file contains an HTML fragment describing bank account details for direct deposit into the retailer's account.
- cheque.htmp
- This file contains payment details for correct addressing of cheque payments.
Substitutions
The template files allow some basic substitutions of variables from within the CGI scripts themselves. Substitutions may come from:
- form variables (temporary values passed from the client or altered by the scripts)
- session variables (persistent values maintained by the CGI scripts for the session)
- config variables (values determined by the webshopper configuration)
- (ANY) specifying a simple name will find the first match in any of the above.
Substitutions are delimited HTML style in angle brackets, beginning with an equals sign. i.e. <=variable> The following examples can be found in existing template files:
<=session.login_message> (Message identifying current login details or session expiry)
<=session.name> (Name of person currently logged in)
<=config.company> (Company webshopper is for)
<=TOTAL> (transaction total. only in tendering)
