3 month of free 24/7 email support for buyers.
Developer manual
From version 2.2 CafeEngine has a themes. You may choose theme using "Theme" in
Settings: Site in admin zone. Theme is just a folder which would have sub-folder
"tpl" with template files described below.
CafeEngine templates are Smarty(tm) templates. About Smarty syntax you can read
here: http://smarty.net/docs.php.
Template architecture is easy and flexible. There is main site template called
template.tpl and there are page depended templates.
Here is full list of PHP files with their templates that are show cafe /
restaurant site to end user:
contact.php (contact.tpl) - contact form functionality
dish.php(dish_show.tpl) - page with meal description
gb.php(gb.tpl) - GuestBook pages
index.php(page.tpl) - regular site pages
menu.php(dish_list.tpl) - lists of meals
order.php(order.tpl,no_order.tpl) - on-line order page functionality.
review.php(review.tpl,review_form.tpl,review_show.tpl) - review functionality.
You may have different templates for different kind of pages. Each of listed
PHP files has definition of "$maintemplate" variable. You may easily change this
variable to use different main template. More of than: you may use different
main templates for different pages of the site. For example, replace line
$maintemplate="template.tpl";
in index.php to
$maintemplate=($_GET['id']=='1')?"main_page.tpl":"template.tpl";
to use main_page.tpl as a main template for home page.
Here is full description for variables accessible from templates.
Variables accessible on any page:
$options
Array of all CafeEngine settings. Also you can see them in include/options.php. Array can have following values:
[db_*]=> Database connection data
[db_prefix]=> Database table prefix. Can be useful to use one database for few projects
[allowed_images]=> Array of image file extensions. Not used now.
[custom_folder]=> Folder where CafeEngine will store uploaded images. Relative to site root. No "/" first required.
[URL]=> URL of the cafe/restaurant site.
[check_email]=>To check that entered by user email address is correct(=1) or no(=0)
[mail_way]=> Way that CafeEngine use to send emails. Can take 3 values: 1 - use PHP mail() function, 2 - use sendmail system routine, 3 - use SMTP server.
[mail_from_email]=>"From" email address for system messages
[mail_from_name]=>"From" sender name for system messages
[mail_smtp_*]=> SMTP setting (if mail_way option equals to 3)
[order_email]=> email address for new order notifications
[contact_email]=> email address for new submitted contact forms
[guestbook_email]=> email address for new submitted GuestBook messages
[review_email]=> email address for new submitted Review
[currency]=> currency for menu prices / orders / etc.
[start_hour*]=> Hour when cafe / restaurant start to take orders. "*" is a number of a day of week, 1 - Sunday ... 7 - Saturday
[end_hour*]=> Hour when cafe / restaurant finish to take orders. "*" is a number of a day of week, 1 - Sunday ... 7 - Saturday
[tax]=> % of tax to add to order sum
[cafe_delivery_cost]=> Sum to add to order if visitor chosen 'Delivery' as shipping method
[minutes]=> Not used in this version
[time_format]=> Time format used on cafe or restaurant site. See http://www.php.net/strftime for further details
[date_format]=> Date format used on cafe or restaurant site. See http://www.php.net/strftime for further details
[time_align]=> This option is required to convert server system timestamp to cafe or restaurant local time. It is difference between these 2. In seconds.
[page_size]=> How much items to show per page. Everywhere at the site.
[months]=> Array of months names index from 1 to 12.
[admin_login]=> Login for admin side. Do not recommend to show.
[admin_password]=> md5 of password for admin side. Show prohibited.
[use_secure_code]=> To use(=1) or no(=0) image with secure code in each form.
[name]=> cafe or restaurant name
[city]=> city where cafe or restaurant is located
[address]=> physical address where cafe or restaurant is located
[phone]=> cafe or restaurant reception phone
[keywords]=> keywords that used on every page of site.
[title]=> title for each page of site
[menunames]=> array(index starts from 1) with system names of menus of site navigation. There Items by default: 'main', 'left' and 'bottom'. These are system internal labels.
[theme]=> Name of folder with current theme
[order_days]=> number of days to get on-line orders for. Not used in this version
[delivery]=> allow(=1) or no(=0) delivery as shipping method for online orders
[order]=> allow(=1) or no(=0) on-line orders
[use_volume]=> use "volume" column in memu or no
[use_menu_specials]=> use "special"(see administrator reference) section in menu or no
[cc_in_db]=> keep credit card information in database or no
[messaging_order_added]=> message to show after one meal added to order
[messaging_order_done]=> message to show after online order is submitted.
[messaging_gb_head]=> message in GuestBook form header
[messaging_gb_added]=> mesasge to show after GuestBook message added
[messaging_contact_head]=> message in Contact Form header
[messaging_contact_added]=> message to show after Contact Form is submitted
[messaging_meal_removed]=> message to show after meal removed from order
[messaging_review_added]=> message to show after visitor submitted new review
[sql_use_charset]=> Enforce SQL to use UTF-8 charset.
$site_menues - Array with all site navigation. Index is an item from $options['menunames']. Value - Array with following values: ["title"]=>link title, ["link"]=>URL.
$language - Array with all site wording. Can be changed from /admin/index.php?section=wording if /options folder and all contained files has right permissions.
Page-dependent template variables:
contact.tpl -
$cm - array with data submitted to contact form by user last time if form was rejected.
dish_list.tpl -
$cats - array of all meals menu sections indexed by section IDs. It has following structure:
[name] - name of section
[image] - extension of section image
[ord] - order of a section in section list
[ph*] - headers for first, second and third prices of meals in this menu section
[dishes] - array of meals to show in this section. It has following structure:
[cat] - ID of menu section
[ord] - order of meal in section
[name] - name of meal
[description] - short description of the meal
[description1] - full description of the meal
[volume] - description of size of portion
[price] - 1st price of meal
[price1] - 2nd price of meal
[price2] - 3rd price of meal
[image] - image extension of the meal
dish_show.tpl -
$dish - array with meal data to show.
[cat] - ID of section
[ord] - order of meal in section
[name] - name of meal
[description] - short description of the meal
[description1] - full description of the meal
[volume] - description of size of portion
[price] - 1st price of meal
[price1] - 2nd price of meal
[price2] - 3rd price of meal
[image] - image extension of the meal
$cat - array with menu section data where meal is located
[name] - name of section
[ord] - order of section
[image] - extension of section image
[ph*] - 3 headers of prices for a meal(* = 1,2 or 3)
[ch] - header for comment box for meal
$opts - array of options for the meal. Key of this array is an ID of options group
[name] - name of options group
[ord] - order of section
[opts] - array of options in the goup. Key of this array is an option ID:
[name] - name of option
[price] - price of option
[ord] - order of option in group
$rels - array of meals related to current.
[id] - ID of related meal
[cat] - ID of section of related meal
[name] - name of related meal
[description] - short description of related meal
[volume] - description of size of portion of related meal
[price] - 1st price of related meal
[price1] - 2st price of related meal
[price2] - 3st price of related meal
[image] - extension of an image of related meal
[ord] - order of meal in list of releted meals
[rid] - ID of relation
gb.tpl -
$gb - array with data submitted to guestbook form by user last time if form was rejected.
$gb_list - array with page of GuestBook messages. Indexes is ID of message. Has following structure:
[nick] - sender nickname
[message] - message text
[sentdate] - date and time when message was sent
$page_no - number of current page(starting from zero)
$pages - array with page numbers
order.tpl -
$oh - array with data submitted to order form by user last time if it was rejected or there is cookies. Has following structure:
[person] - name of the customer
[email] - email of the customer
[phone] - phone of the customer
[address] - address of the customer
[city] - city of the customer
[state] - state of the customer
[zip] - zip code of the customer
[shipping] - shipping method for the order. "1" for pickup and 2 for delivery.
$hide_cc - set to "1" if there is no accepted credit card types. No value else. No credit card information fields shown if this variable set to "1".
$ordhours - order hours submitted by user last time if form was rejected.
$orddays - order day submitted by user last time if form was rejected.
$ordminutes - order minutes submitted by user last time if form was rejected.
$ordcomment - order comment submitted by user last time if form was rejected.
$orddelivery - order delivery comment submitted by user last time if form was rejected.
$order - array. List of meals added to order. Has following structure:
[cat] - meal section ID
[ord] - order of meal in section
[name] - name of meal
[description] - short description of a meal
[portion] - description of portion
[image] - extension of an image of meal
[volume] - ordered quantity
[quantity] - quantity of meal
[price] - "price","price1" or "price2" depends on what price cosen by customer
[comment] - value of comment for a meal
[actual_price] - sum of a line order with meal price and all options
[opt] - array with chosen meal options. Key is option group ID. Value is an ID of option.
[options] - array with meal options data. Has following format:
[ohname] - name of group of an option
[oname] - name of option
[price] - price of option
$emonths - array of month. Shown as credit card expiration month.
$eyears - array of years. Shown as credit card expiration year.
$hours - array of hours. Used to show hours select box at the order form.
$minutes - array of minutes. Used to show minutes select box at the order form. See $options[minutes]
$days - array of days. Used to show days select box at the order form.
no_order.tpl - shown when cafe / restaurant does not accept orders
$lang_opts - array with working schedule of cafe / restaurant each element of it has following structure
[wd] - language label for weekday
[sh] - timestamp for time when cafe / restaurant opens at this weekday
[eh] - timestamp for time when cafe / restaurant closes at this weekday
review.tpl - show review list
$page_no - number of current page
$pages - array with numbers of pages
$review_list - array with current page of reviews. Each element of it has following structure:
[name] - name of review author
[email] - email of review author (we do not recommend to show it)
[title] - title of review
[review] - text of review
[rating] - overall cafe / restaurant rating
[rating*] - rating for parameter number *. (*=1,2,3 or 4)
[added] - timestamp of date and time when review added
review_show.tpl -
$review - array with review data. Has following fields:
[name] - name of review author
[email] - email of review author (we do not recommend to show it)
[title] - title of review
[review] - text of review
[rating] - overall cafe / restaurant rating
[rating*] - rating for parameter number *. (*=1,2,3 or 4)
[added] - timestamp of date and time when review added
[ip] - IP address of author
[visible] - =1 if review approved by administrator. =0 otherwise
review_form.tpl -
$review - array with entered review data if form was rejected. Has following fields:
[name] - name of review author
[email] - email of review author (we do not recommend to show it)
[title] - title of review
[review] - text of review
[rating] - overall cafe / restaurant rating
[rating*] - rating for parameter number *. (*=1,2,3 or 4)
page.tpl -
$page - array with requested page data. Has following structure:
[title] - title of the page
[keywords] - keywords
[header] - header
[content] - content
|