Drost-Tenfelde.de

Personal website of Jannes Drost-Tenfelde, resident bass trombone player at Cologne Concert Brass and Brass Band Merum

User Tools

Site Tools

Command disabled: backlink

Sidebar

General

Upcoming Events

  • CCB: Open Air
    28 September 2014 10:00-17:00

    Location: Rondorf

Music

Media

IT

Additional

dokuwiki:plugins:onlineordering

onlineordering Plugin

The OnlineOrdering Plugin for DokuWiki allows you to create forms by which users can order items online. After successfully filling out the forms, the user will receive an e-mail with the order and the necessary payment information.

This is the first version of the plugin. If you have suggestions for improvements, please send an email to info@drost-tenfelde.de.

Instalation

  • Extract the archive into your lib/plugins directory. Make sure the files are put into a directory called onlineordering.
  • Done! You are now ready to use OnlineOrdering.

How it works

There are three steps the user must take before an order is completed.

Order Form

The first step is filling out the order form, where the user must fill out the fields. Each field is validated. If a field is incorrect or a required field is empty, the user will be presented with the appropriate error messages.

Confirmation Form

When all fields are valid, the user will be presented a summary of all the data he/she has entered. In addition, the price for the ordered tickets is calculated.

Total price = (nr of tickets * ticket price) + porto

Where porto may differ for different countries. This can be setup using the Syntax parameters.

Sending Order Form

Once the user has confirmed the entered data, he/she will be forwarded to the sending order form, where an e-mail will be prepared and sent to the user.

The e-mail can be customised and typically contains the order information, along with the information entered by the user in the order form.

Examples/Usage

{{onlineordering>
item_name=My Personal CD
&abbreviation=MPCD
&currenty=Euro
&porto_default=1
&porto_The Netherlands=0,5
}}

View the Online Demonstration

Syntax

{{onlineordering>key=value&..&key=value}}

key the parameter key to set required
value the parameter value to set required

You can set more than one element at once by using an & delimiter.

Available parameters:

Key Type Comments
item_name string Name of the item required
abbreviation string The abbreviation will be used for generation of a unique order key, by which the exact order can be identified required
currency string Currency of the item price required
porto_default number Default porto cost optional
porto_<country> number Porto for a specific country. Example: porto_The Netherlands will allow you to set the porto for The Netherlands. If no porto has been set for the specific country, porto_default will be used. Available countries can be set in the plugin's configuration parameters. optional
sender_name String Name of the service that sends the e-mail. If this parameteris not set, the value of the configuration parameter sender_name will be used. optional
sender_email email E-mail address of the service that sends the e-mail. If this parameter is not set, the value of the configuration parameter sender_email will be used. optional
email_cc string E-mail addresses, seperated by commas, to which a copy of the sent e-mail is sent. If the parameter is not set, the value of the configuration parameter email_cc will be used. optional
countries string List of countries, seperated by commas. If this parameter is not set, the configuration parameter countries will be used. optional

Configuration and Settings

Key Type Comments
sender_name string Name that will be used for sending out orders via email. optional
sender email email E-mail address that will be used for sending out orders 1) required
email_cc email E-mail addresses (comma seperated) to which a blind copy of the order will be sent via e-mail. 2) optional
bank_account textarea The bank details where the user can make payments for the ordered items required
countries string Comma seperated list of countries. Example: Germany,The Netherlands,Great Britain required
signature textarea Signature that will be appended to the email. optional

Style.css

The stylesheet allows you to change the look and feel of error codes that are displayed to the user.

#onlineordering_plugin {
    padding: 5px;
}

#onlineordering_error {
    color: #000000;
    clear: both;
    padding-left: 20px;
    padding-right: 20px;
    border-bottom: 1px solid #FF9999;
    background: #FFAAAA url('images/error.gif') no-repeat;
}

#onlineordering_error #parameter {
    color: #FF0000;
    font-weight: bold;
}

Where

#onlinerordering_error

is the div for the complete error message.

and

#onlineordering_error #param

allows you to manipulate the look and feel of the error parameter.

E-mail templates

The email template is a text file template_<lang>.txt that will be used for sending out the e-mail to the user. The default file template_en.txt will be used if no language specific template can be found.

In the template file, a complete e-mail can be prepared for the user, using several special fields that will be automatically filled in by the plugin.

Template fields

Tag Comments
{title} Mr. or Ms.
{firstname} The user's first name
{lastname} The user's last name
{street} The user's street + number
{place} The user's village or city
{country} The user's country
{nr_tickets} The number of tickets the user ordered
{item_name} The item name
{currency} The currency
{price} The price per ticket
{porto} The porto
{date} The date the item was ordered
{time} The time the item was orderd
{datetime} The date and time the item was ordered
{ticket} The automatically generated ticket identifier. This identifier consists of the provided abbreviation (see Syntax) along with a 5 digit random number.
{total_price} The calculated total price. Formula: ( nr of tickets * ticket price ) + porto

Files

Here is a list of the files currently used in the plugin.

Source Code
syntax.php Contains the main plugin code
order_form.php Contains the code for displaying the order form
confirm_form.php Contains the code for displaying the confirmation form
send_form.php Contains the code for sending the order e-mails
Customizable
template_en.txt Default (english) language email template, which will be sent to the user after confirming the order
template_<lang>.txt Optional alternate templates for different languages
style.css Stylesheet for plugin specific layouts
images/ Images for Stylesheet
Support
plugin.info.txt Plugin information
Configuration
conf/metadata.php Metadata settings
conf/default.php Default settings
Language
lang/en/lang.php English language file

Development

Change Log

  • **2011-09-29
    • Initial release

Demonstration

1) Typically, this is a noreply address
2) Typically, this holds the address of the person handling the transactions
dokuwiki/plugins/onlineordering.txt · Last modified: 2013/01/22 22:40 (external edit)

Page Tools