Official Documentation Joomla Vik Extensions by e4j

Vik Restaurants Official Documentation

Vik Restaurants - Documentation

Version: 1.7

Dashboard

This is the default page displayed when opening the administrator section of VikRestaurants.

The Dashboard displays a useful summary of the take-away orders and the restaurant reservations.

It is useful to leave the Dashboard page opened in background to check all the new reservations received, because the page is automatically updated via AJAX every TOT minutes (you can specify the Refresh Time from the configuration). Every time the system finds a new reservation, it is played a notification sound.

Restaurant Overview

The Restaurant Overview is used to see in real time the availability of the tables for all the hours of a certain day.

By clicking on a light blue cell you will be able to create a new reservation. By clicking on a green cell you will see the details of the reservation.
Green cells can also display the current reservation code, so that you can immediately check the status of the whole room.

Red cells indicate it is not possible to store a reservation for the selected date. The reasons may be: date in the past, room closed or restaurant closed.

It is possible to change the length of the times by switching value from the dropdown next to the datepicker.

The Stop Incoming Reservations button is used to stop receiving restaurant reservations, such as a Panic Button. This button stops the reservations only for the current day. You can restart receiving restaurant reservations by clicking this button again.

Vik Restaurants - Dashboard

Restaurant Reservations

The Restaurant Reservations section is a summary that contains all the following tables:

  • Latest Reservations - the latest ten reservations made.
  • Incoming Reservations - the ten closest incoming reservations.
  • Current Reservations - the first ten current reservations.

Vik Restaurants - Dashboard 2

Take-Away Orders

The Take-Away Orders section is a summary that contains all the following tables:

  • Latest Take-Away Orders - the latest ten orders made.
  • Incoming Take-Away Orders - the ten closest incoming orders that need to be prepared.
  • Current Take-Away Orders - the first ten current orders that should be delivered/picked up.

The Stop Incoming Orders button is used to stop receiving take-away orders, such as a Panic Button. This button stops the orders only for the current day. You can restart receiving take-away orders by clicking this button again.

Vik Restaurants - Dashboard 2

Restaurant

The Restaurant section of VikRestaurants contains the Rooms, the Tables, the Tables Maps, the Menus, the Products and the Reservations.

All the features contained in this section are used to build and manage the reservation system of your restaurant.

Rooms

In this task you can manage the rooms/areas that your restaurant might have. Even if you want to disable the choice of the rooms/areas in the search page, you have to create at least one room/area.

  • Name - the name of the room.
  • Description - the extended html description displayed in the room details in the search result page.
  • Published - this option must be enabled if you want to receive reservations for the tables on this room.
  • Image - the rooms can have a background image. The image will be displayed only whether the program allows the customers to choose a table.
Rooms Closures

The Rooms Closures are used to unpublish automatically some rooms on certain periods of the year. In example the "Garden" area could be closed from 21st September to the 21st March.

The rooms can be also closed on a single day for some hours. This function is usually used to block reservations on certain rooms when they are almost full.

  • Room - the room to close.
  • Closed From - the starting date-time to close the room. Specify Date, Hours and Minutes.
  • Closed To - the ending date-time to close the room. Specify Date, Hours and Minutes.
Tables

With this task you can create the tables of your restaurant in a non-graphic way. You can create tables only if exists at least one room. Even if you want to disable the possibility to choose tables in the search page, you have to create all the tables of your restaurant in order to build a correct availability system.

The tables created from this page will be placed on the map following a grid layout.

  • Name - the name of the table.
  • Minimum Capacity - the minimum number of people that this table can host.
  • Maximum Capacity - the maximum number of people that this table can host.
  • Can be Shared - multiple reservations will be accepted for this table at the same date and time. If this option is enabled, the table will be available for a number of people smaller than Maximum Capacity minus current number of people. When you have some near tables that can be merged, you should create only one shared table with the sum of their Maximum Capacity.
  • Published - enable this option if the table can be booked from the front-end. Even if this option is disabled, the table is still bookable from the back-end.
  • Room/Area - assign the room/area of this table.
Tables Maps

The Tables Maps page helps you to create your restaurant map (with all the tables) and to manage all the reservations graphically.

Before all, you have to pick a room from the apposite dropdown to see how it looks like.

By using date and time filters you will see the occupancy of your tables at the selected time. 

Vik Restaurants - Table Maps

Reservations Management
  • Select a Room - Choose the room to display its map. The selected room will be stored in the session to be available also after a page refresh.
  • Reservation Search - Choose the date, time and people to see the reservations search result. The tables available will be shown with a green border, while the tables already reserved (or without compatible capacity), will be displayed with a red border.
Tables Appearance & Actions

Vik Restaurants -  Tables Appearance & Actions

  • Reserve - to reserve an available table, click on Reserve link. You will be redirect to the Reservation Management page with the selected date, time, people and table already filled in the creation form.
  • Change Table - to move the reservation of a table to another table click on Change Table link. If you can't move a reservation, it means that the destination table has just been reserved or the old table doesn't have a reservation at this date and time. You can move a reservation of a standard table to a shared table, but not viceversa.
  • Details - open the details of the reservation in a different tab of your browser.
Map Customization

To customize a room graphically you have to select a room and click the Edit button on the top-left side.

  • Add New Table - press the "Add New Table" button to create and insert a new table on the map. The table will be created with these default values: Name = t[TABLE INDEX+1], Min Capacity = 2, Max Capacity = 4, Can Be Shared = false, Room = Current Room/Area, Position x(left) = 40+offset_left, Position y(top) = 40+offset_top, Width = 90, Height = 90, Rotation = 0°, Background Color(HEX) = #A1988D. These default values can be changed from the properties of the map. Each time you add a new table, the program tries to place it following a Grid Structure.
  • Clone Table - press the "Clone Table" button to activate the cloning feature. Click on a table to clone it or re-click on the clone button to deactivate the cloning action. The cloned table will be displayed over the original one with a hash before the name.
  • Align Horizontally - press the "Align Horizontally" button to activate this feature. Click on a table to choose it, then click on a second table to set the same vertical position to the first table. You can see the preview simply moving the cursor above any table.
  • Align Vertically - press the "Align Vertically" button to activate this feature. Click on a table to choose it, then click on a second table to set the same horizontal position to the first table. You can see the preview simply moving the cursor above any table.
  • Delete Table - to remove a table click on the "X" link on the top-left side. A modal box will be displayed to confirm the action.
  • Options - set the options of the table through the apposite modal box. You can change Name, Capacity & Can-Be-Shared options. Apply command confirms the selected options, the Cancel command restores the previous values. You can open only one options modal box per time.
  • Properties - set the properties of the table through the apposite modal box. You can change Position, Size, Rotation & Background Color. Apply command confirms the selected properties, the Cancel command restores previous values. You can open only one properties modal box per time.
  • Move Table - you can move a table manually by dragging it.
  • Resize Table - you can resize a table by dragging the icon on the bottom-right corner.
  • Map Height - to increase or decrease map height there are two buttons below the map. Increase command adds 50 pixel to the height of the map. Decrease command removes 50 pixel from the height of the map.
  • Save Work - if you are satisfied of your work, click the save button, otherwise click cancel to restore the previous map (you cannot retrieve the latest changes). If you change the map size and press save button, the new height will be stored. Every map can have a own height.

Vik Restaurants - Edit Map

Map Properties

You can access to the map properties from the "Settings" icon on the right side above the map.

  • Name Prefix - the new tables will be created with the selected prefix.
  • Start Pos X - the left coordinate for the first tables of each row in the map.
  • Start Pos Y - the top coordinate for the first table in the map.
  • Table Min Width - the minimum width of a new table.
  • Table Min Height - the minimum height of a new table.
  • Width per Person - the width of a table is calculated as: (people-2)/2*width_per_people. If the resulting width is less than minimum width, the minimum width will be taken.
  • Height per Person - if you have specified the minimum height, you can ignore this field.
  • Horizontal Spacing - the horizontal distance from the previous table.
  • Vertical Spacing - the vertical distance from the row above.
  • Map Width - the maximum width of the map. Every time you add a table, if there is enough space, it will be added on the right of the previous table, otherwise it will be placed on a new line.
  • Map Height - the maximum height of the map.
  • Display Next - if you enable this option, a ghost table will display where the next table will be placed.
  • Apply - only the next tables will be affected from these properties.
  • Apply To All - all the tables will be affected from these properties.
  • Restore - the properties will be reverted to the factory settings. To apply the changes is required to press the Apply or Apply to All button.

Vik Restaurants - Map properties

Products

The available meals on your restaurant. The meals created can be used to build the menus of your restaurant.

These products can be also added to the bill of the restaurant reservations.

The system supports also the hidden products, which can be used to create temporary (or custom) items that should be added to a certain reservation bill (e.g. tips, service, water and so on...).

  • Name - the name of the meal (translatable).
  • Description - an optional HTML description of the meal (translatable).
  • Price - the base price of the meal.
  • Published - enable this option to show the meal on all the menus that own it.
  • Image - the image of the meal (JPEG images are recommended).
  • Add Variation - click this button to add a new variation of the meal. Fill the name and the additional price of the variation to add it correctly.

Menus

If you want to show on your site the menus of your restaurant, you can create them through this task.

You can insert the meals in a menu only if you have already created some products first.

  • Name - the name of the Menu (translatable).
  • Description - an optional HTML description of the menu (translatable).
  • Published - enable this option if you want to show this menu on the Menus List page in the front-end.
  • Choosable - enable this option if you want to allow customers to pre-selet this menu during the Search step (the Choosable Menus setting in the configuration MUST be enabled too).
  • Special Day - if your menu is visible only for certain special days, enable this option. You can skip working shift(s) and day(s) filter selection, because they can be configured by the Special Day parameters.
  • Working Shift(s) - choose from the dropdown the working shift(s) that you want add (only if the Opening Time Mode is Shifted). If your menu is available for every working shift you can leave this field blank.
  • Day(s) Filter - choose from the dropdown the day(s) that you want add. If your menu is available in every week day you can leave this field blank.
  • Image - the image of this menu. If you don't specify an image, a default image will be always used.

Vik Restaurants - Menu product

Sections

The sections are used as subcategories of a menu. Before to insert any product, you have to create at least one section.

  • Section Name - the name of the section (translatable). You can toggle (show/hide) a section by clicking on the title label.
  • Section Description - an optional HTML description of the section (translatable).
  • Section Published - enable this option if you want to show the section and all the related products.
  • Section Highlight - enable this option if you want to insert a "fast link" to this section in the menu breadcrumb.
  • Section Image - the image of the section.
  • Add Products - to add a product to this section click the Add Product button to display the apposite smart dropdown (containing all the products). Search the product that you want to add and just select it. Then it will be added on the list of the items, with a dotted blue border.
  • Product Charge - the price field near the product name is the charge of the product. If you want to use a different price for the same product in different menus, you can specify here a negative/positive charge to apply to the base cost of the product. In example, Seafood Spaghetti may have a base cost of 6.50 €. You can add this product to the lunch menu without charge and then you can add the same product to the dinner menu with a 3.50 € additional charge, so that for dinner it will cost 10.00 €.

Vik Restaurants - Sections

 

In case the menu details page in the front-end seems to be a bit strange, make sure the sections and the products of the menu are published correctly.

You can check the status of a menu by clicking the preview icon from the menus list in the back-end. This button will open a modal box containing the status (published or not) of each section and product assigned to this menu.

Vik Restaurants - Menus Preview Icon

Vik Restaurants - Menus Preview Modal

Reservations

All the restaurant reservations stored from your customers are visible from this page.
The list of the reservations can be filtered by customer name/mail, order number/key, coupon code, status, date and working shift (only if enabled).

From this page you can create offline reservations (for example reservations upcoming via telephone) in order to maintain the availability of your tables updated.

Vik Restaurants - Reservations List

  • Date - the day of the reservation. After the selection of the date, the system will re-calculate automatically the available times.
  • Time - the time of the reservation. Click the icon next to this option to check all the closest reservations. Click the icon to increase/decrease the time of stay for this reservation. By default the time of stay is given by the apposite setting in the configuration.
  • People - the number of people for the reservation.
  • Table - the table of the reservation. Depending on the search parameters selected, the system will disable all the tables that are not available (you will find a short description next to the table name). It is possible to press the icon to temporarily re-enable all the tables that were considered as not available, so that you can force a table to host a reservation.
  • User - if the user of the reservation is a registered customer of VikRestaurants, it will be used to auto-fill in its details. Click the icon to create quickly a new customer without leaving the page.
  • Customer Name - insert here the purchaser nominative. This nominative is used to display the name of the customer in the reservations list.
  • E-mail - insert here the purchaser e-mail. This e-mail is used to send the notification of the reservation to the purchaser. If you have another e-mail text field in the custom fields, it doesn't matter as the addresses don't have to be the same.
  • Phone number - insert here the purchaser phone number. This field is used to send SMS to the purchaser. If you have another phone number text field in the custom fields, it doesn't matter as the phones don't have to be the same.
  • Deposit - the deposit amount left by the customer.
  • Bill Value - the amount of the bill of the reservation.
  • Bill Closed - mark this option when the purchaser pays the bill.
  • Status - the status of the reservation (for new reservations the CONFIRMED status should be used by default). Every time the status changes, the administrator(s), the operator(s) and the customer will be notified via e-mail (only from the front-end). In case you are changing the status from the back-end you have to check the Notify Customer option in order to send the e-mail to the customer only.
    There are 4 different possible statuses:
    CONFIRMED - the reservation has been approved. The status CONFIRMED is set every time customers complete a payment successfully or when the deposit to leave is equals to 0.00 and the default status is CONFIRMED (config param).
    PENDING - the reservation is stored in the database and the customer has to pay the deposit to reserve the table or has to wait for a manual approval. A reservation remains PENDING only for a limited period (the time is given from the Keep Tables Locked for setting in the configuration). 
    REMOVED - a reservation becomes REMOVED when the customer doesn't pay the order within the maximum established time (see Keep Tables Locked for setting).
    CANCELLED - a reservation becomes CANCELLED when the customer cancels it from the Order page in the front-end. It is possible to disable the order cancellation from the configuration. When a customer cancels its order, it won't be refunded automatically from the system.
  • Payment - choose the payment to use for this reservation. From this dropdown it is possible to select also the unpublished payments. 
  • Notify Customer - if you enable this option, when you save the reservation, VikRestaurants sends automatically an e-mail with the reservation details to the customer.
  • Other Fields - there are also the custom fields, with restaurant group, that you have created (or the default custom fields) and a text area for some notes that only the administrator can see. The required option of the custom fields in this task is ignored.

Vik Restaurants - Reservation Details

Statistics

The statistics page displays the main statistics of the restaurant: total earning , monthly earning and weekly days earning .

The total earning is displayed as header below the filters. The monthly earning is displayed from the list as first row of each month. 

The total earning of the restaurant is calculated on the BILL VALUE of all the CONFIRMED reservations.

The statistics can be filtered by 2 range dates and by week day.

This kind of statistics are useful to understand which are the days that hosted the highest number of people.

Vik Restaurants - Reservation Details statistics

The GLOBAL line indicates the total earning of each month, while the other lines indicate the total earning for each week day of the months.

Exporting

The reservations can be exported by clicking the Export button in the Joomla Toolbar.
By default there are 2 different ways to export the reservations: ICS and CSV.
The reservations to export can be filtered only by date or IDs.

The dates filters will be automatically filled-in with the oldest checkin (start date) and with the furthest checkin (end date) to cover all the CONFIRMED reservations you have on your system.

To filter the reservations by IDs, check the reservations you need to export from the list and then click the Export button.

ICS: the reservations will be exported in a file following the standard structure of the iCalendar format.
The exported file is compatible with all the most important calendar handlers (iCal, Google Calendar, Outlook Calendar and so on), so that you can import it to synchronize your calendars with your reservations manually.

From the configuration of the program it is possible to configure an automated ICS exportation in order to have all your calendars always updated.

CSV: the reservations will be exported in a file following the standard structure of the comma-separated values format.
The exported file is compatible with all the most important spreadsheet applications (Open Office, Excel and so on).

Bill Management

To manage the bill of a reservation you have just to check a row from the reservations list and click the Bill button from the Joomla Toolbar.

From this page, you can assign any product to the selected reservation, in order to calculate automatically the total cost of the bill. Next to the products dropdown, there is a button that can be used to create quickly hidden products (such as water, services and tips). Every time you add a hidden product, it will become immediately available in the products list.

To add a product to the bill of the reservation you have to pick a food from the list, select the quantity of the item, fill some optional notes and press the ADD TO CART button. Every time you add something to the cart, the reservations list on the right side is automatically refreshed as well as the total cost of the bill on the top.

This page can be used also to redeem discounts and coupons or to completely remove them.

To redeem an existing coupon, you have to click the Discount button, select the Apply Coupon method, choose the coupon code from the list and save the details. It is possible to manually override the discount of the coupon code by changing the Amount parameter.

By selecting the Apply Discount method, you will be able to define a custom discount for this reservation but none coupon code will be assigned.

If a reservation already owns a discount or a coupon, there will be available also other 2 methods: Remove Discount and Remove Coupon.

 

Print Reservations

It is possible to print one or more reservations by clicking the Print button from the Joomla Toolbar. The page to print will display the main details of the reservations and the details of the bill, if any.

It is required to check one or more reservations from the list before to print the details. By printing more than one reservation simultaneously, the details will be separated by a dashed line.

After clicking the Print button, the system will ask you to fill a few options before displaying the template to print.

  • Header Text - a HTML description to display above the reservation details (on the top of the page).
  • Footer Text - a HTML description to display below the reservation details (on the bottom of the page).
  • Update Changes - check this option to maintain the changes for future printings. If you leave this option unchecked, the specified texts will be used only temporarily.
SMS Notifications

You will be able to see the Send SMS button in the Joomla Toolbar only if you have configured the SMS APIs in the configuration of the program.

This button is used to send SMS notifications to the customers with the details of their reservations. The content of the message can be created from the configuration.

To send a SMS you have to select at least a reservation and press the Send SMS button. The system will try to send a SMS to the phone number of each selected reservation. Then, you will see a response about the status of the messages (success or failure).

Invoices

It is possible to generate the invoices of the reservations by clicking the Invoice button in the Joomla Toolbar. It is possible to generate multiple invoices by checking more than one reservation from the list. The system will generate the invoice only for the CONFIRMED reservations.

Before to generate the invoices, the system will ask you if you need to send them automatically via e-mail to the address of the customers.

The generated invoices can be seen from the apposite Booking > Invoices page, from which it is also possible to issue the invoices monthly.

Order Statuses

From the Restaurant > Reservations page it is possible to select a certain reservation code from the apposite Code column.

Every time you change code to a certain reservation, the system will update automatically its codes history (also called Order Statuses).

You can see the Order Statuses of a certain reservation by clicking the icon from the same Reservations page. While, the empty icon means the reservation doesn't own any code yet.

Operations

The Operations section of VikRestaurants handles the Working Shifts, the Special Days and the Operators.

The features of this section are mainly used to configure the working times of the restaurant.

Working Shifts

If you don't use a continuos working time (for example from 2:00 am to 11:00 pm) you should use the Working Shifts. With this task you can create one or more working shifts (for example lunch from 12:30 pm to 14:45 pm and dinner from 19:00 pm to 23:30 pm).

The working shifts are automatically applied to all the week days.

If you need more flexible working days, you have to combine them with the Special Days.

In order to use the working shifts, it is required to switch the Opening Time Mode setting from continuous to shifted (see Global configuration).

  • Name - the name of the working shift. This value is used only as identifier.
  • Show Label - enable this option if you want to show the label of the Working Shift in the time dropdown.
  • Label - the label to display in the time dropdown. Ignore this field if you don't want to show labels.
  • From Hour - the start hour and minutes of the working shift.
  • To Hour - the end hour and minutes of the working shift. This value must be greater than the starting time of the shift. If your shift ends after 11:55 pm you have to create another working shift.
  • Group - specify for which group this shift have to be used (Restaurant or Take-Away).
Special Days

This task offers you a powerful tool to manage your special days. A special day can be a single day, a limited period or an unlimited period.

It is possible to show different Menus for some special occasions and apply different values for the Deposit.

The Special Days can be used also to assign different working shifts to different days of the week.

  • Group - the group of the Special Day (Restaurant or Take-Away).
  • Name - the name of the Special Day.
  • Start Date - choose the start date of the special day. If your special day has not an end date, leave this option blank.
  • End Date - choose the end date of the special day. If your special day has not an end date, leave this option blank. The end date option must be equal or greater than the start date option. If your special day is a single day, the end date must be equal to the start date.
  • Working Shift(s) - only if the working shifts are enabled, pick the times in which the restaurant or the take-away is open.
  • Day(s) Filter - select the days in which the restaurant or the take-away is open.
  • Deposit Per Reservation - this option is an override of the global Deposit per Reservation setting. You could set this value to zero for lunch or increment it for Christmas. Only for Restaurant.
  • Deposit Per Person - this option is an override of the global Deposit per Person setting. If this option is enabled, the deposit value will be multiplied for the number of people of the reservation. Only for Restaurant.
  • Maximum People Allowed - when this value is set to Unlimited, people will be able to book a table until all the tables will be occupied. Otherwise you can set a maximum quantity allowed to stop reservations when the capacity of the room is higher than the specified value. Only for Restaurant.
  • Service - this option is an override of the global Delivery Service setting. You could set the Only Pickup option to disable the delivery service in certain days of the week. Only for Take-Away.
  • Mark On Calendar - if you want to mark your special day in the jQuery calendar, you should enable this option.
  • Ignore Closing Days - if your special day is in conflict with a closing day, you can enable this option to make it more important and ignore the closing day.
  • Priority - set a higher priority level for the special day to be considered first. This value is required when more than one special day can be retrieved simultaneously.
  • Choosable Menus - this option is an override of the global Choosable Menus setting. In this way, you can allow the customers to pre-select a menu for certain occasions. Only for Restaurant.
  • Menus - pick the available menus on this special day. This option can be used also for take-away to filter menus in some days of the week.
  • Images - You can add multiple images for the special days, which will be displayed through the VikRestaurants Event Module, used to advertise your special days.

Vik Restaurants - Special Day

Operators

The operators are the employees that work on your restaurant.

You have to create at least one operator if you want to use the Live Map & Management Area in the front-end.

Details
  • Operator Code - if you have already a code for your operators, you can specify it here. Otherwise a random number will be used.
  • First Name - the first name of the operator.
  • Last Name - the last name of the operator.
  • E-mail - the e-mail address of the operator.
  • Phone Number - the phone number of the operator.
  • Group - specify the group to which the operator should belong. Leave this field empty if the operator is able to handle the restaurant and the take-away.
  • Login User - the Joomla user account to login into the Live Map. If the operator doesn't have an account yet, you can create it from this page by filling the registration fields.
Actions
  • Enable Login - enable this option if you want to allow the operator to access into the Live Map page in the front-end.
  • Keep Track Actions - enable this option if you want to store all the actions performed by this operator. The actions performed will be visible by clicking on the Report image in the operators list.
  • Mail Notifications - enable this option if you want to send an e-mail notification to this operator every time a new reservation/order is placed.
  • Manage Coupons - enable this option if the operator is able to manage the coupons.
Booking

The Booking section of VikRestaurants contains the Customers, the Reviews, the Coupons and the Invoices.

Customers

The customers view is used to collect all the details of your clients.

customer will be created automatically every time a new logged-in user places a new order from the front-end.

You can see the number of CONFIRMED reservations/orders made from your customers and you can also sort them to see a best-purchaser ranking.

Billing Details
  • User Account - the Joomla User assigned to this customer. If the customer doesn't have a Joomla User, you have to select the "Guest" option. By selecting the "Create New Account" option you will be asked to enter username, e-mail and password to create a new Joomla User. The Joomla User will be assigned automatically after saving.
  • Name - the billing full name of the customer.
  • E-mail - the billing e-mail address of the customer.
  • Phone - the billing phone number of the customer. The phone prefix (like +1) MUST NOT be specified because it will be retrieved from the selected country.
  • Country - the billing country of the customer.
  • State - the billing state of the customer.
  • City - the billing city of the customer.
  • Address - the billing address of the customer.
  • Address 2 - a secondary optional billing address of the customer.
  • Zip - the billing zip code of the customer.
  • Company Name - the billing company name of the customer.
  • Vat Number - the Vat Number of the customer.
  • SSN / Fiscal Code - the social security number / fiscal code of the customer.
  • Notes - if you need to insert some additional notes about the customer, you can use this field. This value will be visible only from the administrator.

Vik Restaurants - Customer Billing Details

Delivery Locations

The list of the delivery addresses of the customer. These addresses can be used to fill-in quickly the address custom field (take-away only), in order to calculate the delivery cost.

To create a new delivery address, just fill at least one field from the apposite form. After saving the changes, you will still be able to create a new delivery address.

Vik Restaurants - Customer Delivery Locations

Custom Fields

The custom fields filled-in during the purchase. You can leave these fields empty if you are creating a new customer from the back-end.

Vik Restaurants - Customer Custom Fields

SMS Notifications

From the customers page you are able to send custom SMS notifications by clicking on the Comics icon under the Send SMS column.
Only the blue-filled icons allows you to send a SMSNon-filled icon means the customer doesn't own a phone number.

From the dialog you are asked to insert a short message (maximum 160 characters) to send to the customer.

If you check the Remember option (keep this text as default), the message will be stored and it will be displayed as default every time you need to send a (custom) message.

Vik Restaurants - sms

Reviews

If you want to receive reviews for your products, you have to configure the Reviews section in the global configuration of VikRestaurants first.

The reviews have a mandatory stars rating (from 1 to 5), a mandatory title and an optional/mandatory description (depending on the configuration of the program).

The reviews are supported only by the take-away products.

  • Title - the title of the review (max 128 characters).
  • User - the existing Joomla account of the user.
  • Name - the name of the user..
  • E-mail - the e-mail address of the user.
  • Date - when the customer submitted the review from the front-end. This value can be changed from the back-end.
  • Rating - the number of stars to represent the rating of the product (from 1 to 5).
  • Published - disable this option if you want to hide this review without deleting it. By default all the new submitted reviews are automatically published, but it is possible to disable this option to publish them only manually.
  • Verified - the verified badge means that the customer who left the review has really purchased the product.
  • Product - the product rated.
  • Language - the language tag of the review. When a customer submits a new review, the lang tag will be equal to the language set in the front-end. This option is used to filter the reviews by language.
  • Comment - the description of the review. The maximum characters length can be defined from the configuration.

Listing

The reviews are listed in 2 different pages: take-away item details and take-away item reviews.

The Item Details page can be accessed by clicking on the name of an item within the default Take-Away Menus page. These kind of pages can be also published as new menu items, so that you can have links that point directly to the details page of your items.

The Item Details page shows the latest reviews left that contain a comment. To see all the reviews left for an item, it is needed to click on the See All Reviews button to go into the Item Reviews page (see screenshot below).

The reviews are also used by the Take-Away Grid module.

Leave a Review

It is possible to leave a review only from the Item Reviews page by clicking the Leave Review button.

The fields that own the * inside the label are required to leave the review. To choose the rating you have to click the stars box, hover the mouse to the rating you need (1, 2, 3, 4 or 5 star) and click it.

If you seem to be not able to leave a review for an item, make sure you haven't already posted it (for the same item) and try to check the configuration section of the reviews.

Coupons

The coupons system allows you to create discounts that will be applied to the deposit amount for the restaurant reservations or to the total cost of the take-away orders.

Coupons can be used also to save in the reservations a code/reference that could belong to one of the promoters of your restaurant.

  • Group - the group for which the coupon should be used (restaurant or take-away).
  • Code - the code of the coupon that the users will have to enter to redeem it. It can be at most 64 characters long and it can contain any letter, number or symbol. The code should not contain white spaces.
  • Type - the type of the coupon (Permanent or Gift). A permanent coupon always applies the discount when it is used. Instead, a gift coupon can be used only once, after that it will be removed from the system.
  • Value - the discount amount to apply, expressed in your currency or in percentage.
  • Date Start - the minimum date required for using the Coupon.
  • Date End - the maximum date required for using the Coupon.
  • Min. People/Min. Order - the minimum number of people needed to apply the discount (Restaurant). The minimum total cost of the orders needed to apply the discount (Take-Away).
Invoices

The Invoices page is the archive of all the invoices you have generated through the internal system of the program.

The navigation on the right-side shows the list of the months that own at least an invoice. While on the other section of the page there is a grid containing all the invoices for the selected month and year. In case there are a lot of invoices, it is needed to press the apposite button(s) to load the remaining ones.

It is possible to search an invoice by:

  • order number (e.g. 684)
  • order key (e.g. D8ULGI57I6BX839D)
  • order number-order key (e.g. 684-D8ULGI57I6BX839D)
  • invoice number (e.g. 12)
  • invoice suffix (e.g. 2017)
  • invoice number/suffix (e.g. 12/2017)

The invoice filtering is always applied to the selected month and year.

VikRestaurants - Invoices Archive

By clicking the invoice name, a PDF will be opened on a different tab of your browser. By clicking the invoice icon, the invoice will be selected. The selected invoices can be deleted or downloaded. In case you need to download a single invoice, it will be downloaded as PDF. While if you need to download multiple invoices, the system will ZIP all them and it will be downloaded as a package.

Invoices Generation

From this page it is possible to generate the invoices monthly.

If you need to generate a few invoices only, you need to do it directly from the reservations/orders page.

  • Group - the group of the invoices to generate (restaurant reservation or take-away orders).
  • Reservations on - the month and the year of the reservations to generate.
  • Overwrite Existing - enable this option if you want to overwrite the existing invoices.
  • Notify Customers - enable this option if you want to send the invoice automatically via e-mail to the customers, after the generation.
  • Unique Identifier - the invoice number and suffix (e.g. 1/2017, or e.g. 1/SFX). The invoice number MUST be an integer. Every time a new invoice is generated, the invoice number is incremented by one.
  • Date - the invoice date, which can be the current day (today) or the date of the checkin (booking checkin).
  • Legal Info - a few lines of text about the legal information of your company.
  • Page Orientation - the page orientation of the invoice: Portrait (vertical) or Landscape (horizontal).
  • Page Format - the page format of the invoice: A4, A5 or A6.
  • Unit - the length unit to use for the invoice: Point, Millimeter, Centimeter, Inch. It is suggested to leave the Millimeter option selected.
  • Scale ratio - the scale ratio to use to resize the images inside the invoice (in percentage).

TIP: if you need to restore the invoice number, for example after deleting an invoice, you can follow the steps below:

  1. open the invoices page.
  2. click the NEW button
  3. select a date in the future which doesn't own any reservation
  4. restore the invoice number
  5. click the SAVE button

In this way, none invoice will be generated and the invoice number will be reset.

Template Customization

In case you need to customize the template of the invoice, you can do it by editing the following files:

-- RESTAURANT --

/components/com_vikrestaurants/library/pdf/restaurant_invoice_tmpl.php

-- TAKEAWAY --

/components/com_vikrestaurants/library/pdf/takeaway_invoice_tmpl.php
Take-Away

The Take-Away section of VikRestaurants contains the Menus, the Toppings, the Deals, the Delivery Areas, the Stocks and the Orders.

All the features contained in this section are used to build your Take-Away system.

Take-Away Menus

From this page you can create one or more take-away menus to allow customers to purchase the meals you have created.

  • Title - the title of the Menu (translatable).
  • Published - enable this option if you want to display the menu and the related items in the front-end.
  • Description - a HTML description of the menu (translatable).
  • Use Taxes - the items of this menu can have a different tax amount or can maintain the global one.
  • Add Entry - this button adds a new entry (food) to the menu. It is required to save the changes to apply the entries to the menu.

Vik Restaurants - Take Away Menu

Take-Away Products

A Take-Away Product (or entry) can be created from 2 different pages: Take-Away Menu Management (see above) and Take-Away Product Management.

It is possible to access the Product Management page from the Menus list, by clicking the ROWS icon under the Products column.
From this page it is possible to configure additional options.

  • Name - the name of the meal (translatable).
  • Description - a HTML description of the food (translatable). If this text is too long, it will be shown a MORE button.
  • Price - the base price of the meal.
  • Attributes - select all the characteristics own from this meal (see Food Attributes section).
  • Image - the image of the meal.
  • Published - when this field is disabled, the meal is not displayed and cannot be purchased.
  • No Preparation - check this field if the entry has no preparation time (e.g. beverages). The No Preparation items selected from the customers won't be considered during the availability search.
  • Menu - if you want to move this meal into a different menu, select the right option from the dropdown (see Take-Away Product Management).
  • Ordering - you can re-order the entries by dragging the whole box from the Move icon.
  • Add Variation - this button adds a new Variation to this entry (see Take-Away Variations). It is not mandatory to have at least a variation.

Vik Restaurants - Take Away Product

Take-Away Variations
  • Name - the name of the variation of the entry (translatable).
  • Price - the incremental price of the variation. The total cost of the food will be BASE PRICE + VARIATION PRICE.
  • Ordering - you can re-order the variations by dragging the whole line from the Move icon. Variations can be sorted only from the product management page.

Vik Restaurants - Take Away Variations

Take-Away Toppings Groups

The Toppings Groups are required when you want to allow your customers to pick additional items for the selected meal. This feature can be used for example to build a Pizza.

In a few words, this is a single or multiple selection of a certain group of toppings that your customers can choose.

Toppings Groups can be handled only from the Take-Away Product Management page (see Take-Away Products).

  • Title - the name of the toppings group (translatable).
  • Variation - limit this group to a certain variation only. This is useful to have different prices of your toppings for each variation. 
  • Multiple Selection - when this option is enabled, more than one topping can be selected through the checkboxes (the selection may be not required). Otherwise only one topping will be available for the selection (the selection is required).
  • Minimum Toppings - the minimum toppings that customers have to pick to add the entry. When the multiple selection is not allowed, this value is set by default to 1.
  • Maximum Toppings - the maximum toppings that customers have to pick to add the entry. When the multiple selection is not allowed, this value is set by default to 1.
  • Add Toppings - by clicking this button you will be able to insert all the available toppings you need into this group. Toppings can have a different price for this group and can also be sorted by dragging the Move icon.
  • Ordering - you can sort the Toppings Groups by dragging the whole block from the Move icon.

Vik Restaurants -  Toppings Groups

Take-Away Food Attributes

The Take-Away Attributes are used to display certain characteristics of your meals.

You can access to the Take-Away Attributes from the Take-Away Menus page, by clicking the Manage Menu Attributes button.

  • Name - the name of the attribute (translatable). This value is used as legend of the icon.
  • Description - a short description of the icon. The description is never displayed and you can use it only as reminder.
  • Icon - the icon that should represent the characteristic of the meal. The icon is required.
  • Published - enable this option if you want to display the attribute. Otherwise it will be automatically hidden from all the meals.

By default there are already 3 pre-installed attributes: Spicy, Vegetarian and Contains Nuts.

Take-Away Toppings

The Take-Away Toppings are used as additional ingredients to certain meals that customer can or have to pick/select.

Here you have to create all the toppings available in your restaurant. The Meals-Toppings assignments can be made only from the Take-Away Product Management page.

  • Name - the name of the topping (translatable).
  • Price - the default price of the topping. This value can be changed during the Meal-Topping assignment.
  • Published - enable this option if you want to use this topping.
  • Separator - choose a separator to assign this topping to a certain group. Separators are used only in the administrator to categorize toppings and make them as clear as possible.

The ordering of the toppings won't affect the ordering of the toppings inside the groups of the meals.

Price Quick Update

By changing the price from the management page of a topping, the rate of the toppings assigned to the products won't be affected.

This means that, every time you need to change a topping price, you have to open the details page of each product and to update manually the topping rate with the same value.

To speed up this process, it is possible to use the Price Quick Update option. This option appears only after changing the price of an existing topping.

The Price Quick Update option owns 3 different actions:

  • Do Nothing - check this option if you don't need to affect any topping product.
  • Update all products toppings - check this option if you need to update the rate for all the products that own this topping.
  • Update products toppings with same price - check this option if you need to update the rate for all the products that own this topping and had the same rate.
Take-Away Deals

The Take-Away Deals are used to offer automated discounts through a smart system based on different types of deals.

You can promote your active deals through the VikRestaurants Take-Away Deals module.

  • Name - the name of the deal (translatable). This value is displayed only as title of the deal from VikRestaurants Take-Away Deals module.
  • Description - an optional HTML description of the deal (translatable). This value is displayed only as description of the deal from VikRestaurants Take-Away Deals module.
  • Start Date - the starting date of the deal. Leave this field empty if your deal is always available.
  • End Date - the ending date of the deal. Leave this field empty if your deal is always available. End Date must be equals or greater than the Start Date.
  • Number of Applies - the maximum number of applies of the deal. Customers can use this offer, during the same order, at most for the specified number of times. Select the Unlimited option to ignore this restriction.
  • Published - enable this option if you want to offer your deals. Unpublished deals won't be displayed in the deals module and won't be considered from the system.
  • Days Filter - you can filter the deals also by week day by selecting them from the dropdown. If you leave this field empty, all the week days will be automatically used.
  • Type - the type of the offer for this deal. There are 5 different types of deals: Above All, Discount Item, Free Item with Combination, Free Item with Total Cost, Coupon and Discount with Total Cost. Each type of deal owns different parameters to fill in.

Vik Restaurants -  Deal Details

Deal Type: Above All

The deal type Above All is used to offer a cost discount above the grand total when a certain combination of items is in the cart.

  • Amount - the amount of the discount. The discount can be a fixed amount (5.00 €) or a percentage amount (10%).
  • Combinations Min Occurrency - this value is used to determinate the minimum occurrence of the combinations in the cart, required to apply the discount.
  • Target Food - the food that can or must be inside the cart.
  • Required - all the required target food must be inside the cart as the quantity specified in the combination.
  • At least one - at least one target food must be inside the cart as the quantity specified in the combination.

Vik Restaurants -  Deal Details Rules

In the example above the deal offers 5€ off when the cart contains 3 (combinations min occurrency) random combinations of the specified items.

In this case, you will get 5 € off by adding to the cart 3 x Wakame, 2 x Wakame and 1 x Takoyaki, 1 x Wakame and 1 x Takoyaki and 1 x Hamachi, etc.

You can see the result of the deal in the image below.

Vik Restaurants -  your cart

Deal Type: Discount Item

The deal type Discount Item is used to offer a discount above certain items.

  • Amount - the amount of the discount. The discount can be a fixed amount (5.00 €) or a percentage amount (10%).
  • Target Food - the food that will be discounted. It is required to specify the minimum quantity in order to apply the discount to the item.

Vik Restaurants -  Deal Details Rules 2

In the example above the deal offers 10% off on the selected meals.

When the quantity is higher than 1, the items won't display the discounted cost in the menus list page.

You can see the result of the deal in the image below.

Vik Restaurants -  Deal Details exampleVik Restaurants -  Deal Details Example 2

Deal Type: Free Item with Combination

The deal type Free Item with Combination is used to gift one or more items when a certain combination of meals is in the cart.

  • Auto Insert Gift Food - enable this option if you want to automatically add all the selected Gift Food into the cart. When this option is disabled and there are more than one gift food, the customer will be able to get for free only one of them.
  • Combinations Min Occurrency - this value is used to determinate the minimum occurrence of the combinations in the cart, required to receive the gift.
  • Target Food - the food that can or must be inside the cart.
  • Required - all the required target food must be inside the cart as the quantity specified in the combination.
  • At least one - at least one target food must be inside the cart as the quantity specified in the combination.
  • Gift Food - the food that can be added for free into the cart.

Vik Restaurants - Free Item with Combination

With the example deal above, customers can choose one of the Gift Food specified every time they add into the cart one of the Target Food.

You can see the result of the deal in the image below.

Vik Restaurants - Free Item nocomb example

Deal Type: Free Item with Total Cost

The deal type Free Item with Total Cost is used to gift one or more items when the grand total is equals or higher a certain amount.

  • Total Cost in Cart - the total cost that the cart must have to gift the specified meal(s).
  • Auto Insert Gift Food - enable this option if you want to automatically add all the selected Gift Food into the cart. When this option is disabled and there are more than one gift food, the customer will be able to get for free only one of them.
  • Gift Food - the food that can be added for free into the cart.

Vik Restaurants - Free item Tot cost

With the example deal above, customers will receive automatically for free a Sesame Prawn Toast when the total cost will reach 10.00 €.

You can see the result of the deal in the image below.

Vik Restaurants - Free item Tot cost example

Deal Type: Coupon

The deal type Coupon doesn't accept any parameter, because it can be only read.

The Coupon deals should be used to promote something on your restaurant, like a coupon code or a free delivery with a certain total cost.

Deal Type: Discount with Total Cost

The deal type Discount with Total Cost is used to apply a discount when the total cost of the order reaches a certain amount.
This type of deal should applied only once.

  • Amount - the amount of the discount. The discount can be a fixed amount (5.00 €) or a percentage amount (10%).
  • Total Cost in Cart - the total cost that the cart must have to apply the offer.

Vik Restaurants - Discount with Tot Cost

With the example deal above, customers will get 20 € off when the total cost of the order will be 80 € or higher.

You can see the result of the deal in the image below.

Vik Restaurants - Discount with Tot Cost example

Take-Away Delivery Areas

The Delivery Areas are used to limit the addresses available for delivery. It is possible to limit the areas in 3 different ways, which can be used also simultaneously. The possible types are: Polygon, Circle and ZIP Codes.

When a customer writes its full address (city name + street name + street number), the system will try to evaluate the area on which it is located, to make sure that address is available for delivery.

The Delivery Areas are considered only when the customers select the DELIVERY type of service.

The Delivery Areas can work only if you use a custom field with ADDRESS rule.

The validation of the address can be made thanks to Google Maps APIs, which are able to recognize the latitude and longitude of a given address. In order to use the Google Maps APIs, it is mandatory to specify your Google API Key from the global configuration of the program.

  • Name - the name of the Delivery Area, used only as identifier.
  • Type - the type of restriction to use. The possible solutions are: PolygonCircle and ZIP Codes.
  • Charge - the additional charge to sum to the base delivery cost.
  • Min. Cost - the minimum total order to proceed with the purchase.
  • Published - enable this option to allow deliveries for this area.

The Polygon and Circle types of area support a few additional parameters to customize the way they look. In fact, both these 2 methods, can be displayed through the apposite VikRestaurants Take-Away Map module.

  • Fill Color - the background color of the shape. Click the icon to select the color you want.
  • Stroke Color - the border color of the shape. Click the  icon to select the color you want.
  • Stroke Weight - the border weight of the shape (in pixel).
  • Display All Areas in Map - enable this option to display all the delivery areas you have inside the preview map, used to create the shape. It is useful to draw new areas next to the existing ones.

Delivery Area: Polygon

The Polygon type of area allows you to create any kind of shape to restrict the available addresses. It is possible to create a polygon simply by specifying each vertex by clicking on the Google Maps you see.

The vertex of a polygon is a point of the Earth and it is built with the latitude and longitude coordinates (in decimal). In case the coordinates of a given address are inside the polygon shape, it means the address is ok for the delivery.

If you are not able to see the map, make sure you have specified a Google API Key from the configuration.

  • Add New Point - press this button every time you need to insert a new vertex of the polygon.
  • Toggle Coordinates - press this button to show/hide the list of your coordinates.

Press the  icon to remove the vertex. This action cannot be undone.

Press the  icon to assign your current GPS coordinates to the vertex.

Press the  icon to highlight the vertex on the map. The vertex will be highlighted with a red pin (marker).

Press the  icon to assign the coordinates to the vertex by clicking on a point of the map. Once you have pressed this icon, just click on a point of the map to replace/set the existing coordinates of the vertex.

Drag the  icon to sort the selected vertex.

Delivery Area: Circle

The Circle type of area allows you to restrict the available addresses within the radius of a given circle center.

The center of a circle is a point of the Earth and it is built with the latitude and longitude coordinates (in decimal). In case the coordinates of a given address are inside the circle shape, it means the address is ok for the delivery.

If you are not able to see the map, make sure you have specified a Google API Key from the configuration.

  • Center - the center (latitude and longitude) of the circle. You can specify these coordinates manually or by clicking a point from the map. Press the  icon to assign your current GPS coordinates to the center.
  • Radius - the radius (in kilometers) of the circle. This amount accepts decimals.

Delivery Area: ZIP Codes

The ZIP Codes type of area is used to restrict the allowed addresses by specifying a list of accepted ZIP codes. In case the ZIP of a given address is included within the list of the accepted ZIP codes, it means the address is ok for the delivery.

This is the only one type of area that cannot be displayed inside Google Maps.

Press the New Zip Code button to insert a new range (from and to) of ZIP Codes (e.g. from 65000 to 65999). In case you don't need to use a range of ZIP Codes (e.g. 65000), you can leave the To Zip field empty. The from and to fields accept also alphanumeric codes (e.g. EX987).

Take-Away Orders

All the take-away orders stored from your customers are visible from this page. The list of the orders can be filtered by customer name/mail, order number/key, coupon code, status, date and working shift (only if enabled).

From this page you can create offline orders (for example reservations upcoming via telephone) in order to maintain the availability of your system updated.

Vik Restaurants - take away order

 

  • Date - the day of the order.
  • Time - the time of the order. Click the icon next to this option to check all the closest orders.
  • Service - the type of service for the order (delivery or pickup).
  • User - if the user of the reservation is a registered customer of VikRestaurants, it will be used to auto-fill in its details. Click the icon to create quickly a new customer without leaving the page. The selection of the user will autoload all the related addresses for the delivery.
  • Address - all the delivery addresses of the selected customers (only if delivery service is selected). In case the user is not specified, the address must be specified through the custom fields. The selection of the address will calculate automatically the delivery charge. In case the address is not valid, the system will ask you if you want to accept it. If you have specified one ore more origins from the configuration, the system will be able to display the distance and the delivery time between your restaurant and the customer address.
  • Customer Name - insert here the purchaser nominative. This nominative is used to display the name of the customer in the reservations list.
  • E-mail - insert here the purchaser e-mail. This e-mail is used to send the notification of the reservation to the purchaser. If you have another e-mail text field in the custom fields, it doesn't matter as the addresses don't have to be the same.
  • Phone number - insert here the purchaser phone number. This field is used to send SMS to the purchaser. If you have another phone number text field in the custom fields, it doesn't matter as the phones don't have to be the same.
  • Total To Pay - the total cost of the order. This cost includes: total net, taxes, delivery charge and payment charge. Click the  icon to check/change all these costs. 
  • Status - the status of the order (for new reservations the CONFIRMED status should be used by default). Every time the status changes, the administrator(s), the operator(s) and the customer will be notified via e-mail (only from the front-end). In case you are changing the status from the back-end you have to check the Notify Customer option in order to send the e-mail to the customer.
    There are 4 different possible statuses:
    CONFIRMED - the order has been approved. The status CONFIRMED is set every time customers complete a payment successfully or when the total cost to pay is equals to 0.00 and the default status is CONFIRMED (config param).
    PENDING - the order is stored in the database and the customer has to pay the total cost of the order or has to wait for a manual approval. An order remains PENDING only for a limited period (the time is given from the Keep Orders Locked for setting in the configuration). 
    REMOVED - an order becomes REMOVED when the customer doesn't pay the order within the maximum established time (see Keep Tables Locked for setting).
    CANCELLED - a reservation becomes CANCELLED when the customer cancels it from the Order page in the front-end. It is possible to disable the order cancellation from the configuration. When a customer cancels its order, it won't be refunded automatically from the system.
  • Payment - choose the payment to use for this order. From this dropdown it is possible to select also the unpublished payments. After the selection of the payment, the payment charge will be automatically updated (if any).
  • Notify Customer - if you enable this option, when you save the order, VikRestaurants sends automatically an e-mail with the order details to the customer.
  • Other Fields - there are also the custom fields, with take-away group, that you have created (or the default custom fields) and a text area for some notes that only the administrator can see. The required option of the custom fields in this task is ignored.

Vik Restaurants - Reservation Details 2

Orders Creation

To insert, edit or remove meals from an order, you have to click the Save & Fill Cart button from the management page of an order.

Total Net Price, TaxesDelivery Charge and Total Cost are automatically updated every time you insert, edit, or remove a meal.

To insert a new meal into the order, you have to pick a food from the apposite dropdown. It will be displayed a creation form with the details of the selected meal, from which you can select the quantity, insert some notes and choose the assigned toppings. Inside this form the system lists also the remaining quantity of items in stock.

To edit an existing meal, you have to click the name of the food from the cart. In this way it will be displayed the same creation form with the details of the selected meal auto-filled in.

Take away Orders Creation

Statistics

The statistics page displays the main statistics of the take-away: total earning , monthly earning and weekly days earning .

The total earning is displayed as header below the filters. The monthly earning is displayed from the list as first row of each month. 

The total earning of the restaurant is calculated on the TOTAL COST of all the CONFIRMED orders.

The statistics can be filtered by 2 range dates and by week day.

This kind of statistics are useful to understand which are the days that received the highest number of orders.

Take-Away Statistics

The GLOBAL line indicates the total earning of each month, while the other lines indicate the total earning for each week day of the months.

Take-Away Statistics graph

Exporting

The orders can be exported by clicking the Export button in the Joomla Toolbar.
By default there are 2 different ways to export the orders: ICS and CSV.
The orders to export can be filtered only by date or IDs.

The dates filters will be automatically filled-in with the oldest checkin (start date) and with the furthest checkin (end date) to cover all the CONFIRMED orders you have on your system.

To filter the orders by IDs, check the reservations you need to export from the list and then click the Export button.

ICS: the orders will be exported in a file following the standard structure of the iCalendar format.
The exported file is compatible with all the most important calendar handlers (iCal, Google Calendar, Outlook Calendar and so on), so that you can import it to synchronize your calendars with your take-away reservations manually.

From the configuration of the program it is possible to configure an automated ICS exportation in order to have all your calendars always updated.

CSV: the orders will be exported in a file following the standard structure of the comma-separated values format.
The exported file is compatible with all the most important spreadsheet applications (Open Office, Excel and so on).

Print Orders

It is possible to print one or more orders by clicking the Print button from the Joomla Toolbar. The page to print will display the main details of the orders and the details of the products purchased.

It is required to check one or more reservations from the list before to print the details. By printing more than one order simultaneously, the details will be separated by a dashed line.

After clicking the Print button, the system will ask you to fill a few options before displaying the template to print.

  • Header Text - a HTML description to display above the order details (on the top of the page).
  • Footer Text - a HTML description to display below the order details (on the bottom of the page).
  • Update Changes - check this option to maintain the changes for future printings. If you leave this option unchecked, the specified texts will be used only temporarily.
SMS Notifications

You will be able to see the Send SMS button in the Joomla Toolbar only if you have configured the SMS APIs in the configuration of the program.

This button is used to send SMS notifications to the customers with the details of their orders. The content of the message can be created from the configuration.

To send a SMS you have to select at least a reservation and press the Send SMS button. The system will try to send a SMS to the phone number of each selected reservation. Then, you will see a response about the status of the messages (success or failure).

Orders Invoices

It is possible to generate the invoices of the orders by clicking the Invoice button in the Joomla Toolbar. It is possible to generate multiple invoices by checking more than one reservation from the list. The system will generate the invoice only for the CONFIRMED orders.

Before to generate the invoices, the system will ask you if you need to send them automatically via e-mail to the address of the customers.

The generated invoices can be seen from the apposite Booking > Invoices page, from which it is also possible to issue the invoices monthly.

Order Statuses

From the Take-Away > Orders page it is possible to select a certain reservation code from the apposite Code column.

Every time you change code to a certain order, the system will update automatically its codes history (also called Order Statuses).

You can see the Order Statuses of a certain order by clicking the icon from the same Orders page. While, the empty icon means the order doesn't own any code yet.

The same order statuses can be seen from the customers by visiting the apposite link sent with the notification e-mail they receive. By default it should be Click HERE to check the status of your order.

 

The image below shows the page that the customers should see after visiting that link.

This feature can be easily used to inform the customers about the status of their orders or to notify them about certain delays. In fact, from the management page of a certain Order Status it is possible to write a custom message that only the owner of the reservation can see.

Take-Away Stocks

The Stock system is used to handle the remaining quantity of products that can be purchased from your customers.

Every time a product is out of stock (or close to be), you have to refill it with the new quantity you own, otherwise the product will be no more selectable from the customers.

When the remaining quantity of certain products is going to finish, the administrator(s) will be notified via e-mail.

To use the stock system, it is mandatory to activate the Enable Stocks System setting from the take-away configuration.

Manage Menu Stocks

In order to use the stock system properly, it is needed to specify the current default quantity of each product you sell.

It is possible to define the current default quantities from the Take-Away > Menus page, by clicking the Manage Menu Stocks button.

From this page it is possible to see the list of the products, related to the selected menu, for which you can define a custom stock. The products can be filtered by menu and product/variation name.

  • Product - the name of the product.
  • Variation - the variation of the product, if any.
  • Default Items in Stock - the initial remaining quantity of the item in stock. The example 9999 value for Takoyaki product means that you can sell at most 9999 Takoyaki(s) until you refill its quantity.
  • Notify Below - receive an e-mail notification when the remaining quantity of this item is equals or lower than this value.

If a product owns some variations, you can press the Update All Variations button to automatically copy the fields of the product (default items in stock and notify below) to all its children (variations).

It is important to understand that the Manage Menu Stocks page MUST NOT be used to refill the quantity of the items.

Stocks Overview

The Stocks Overview page is used to take a quick look at the remaining quantity of all your products. From here it is also possible to refill the quantity of all your products that is going to be out of stock

It is possible to access this view from the Take-Away > Orders page, by clicking the Stocks Overview button.

By default, this page displays a list of products sorted by the number of items in stock: from the lowest to the highest. The products can be filtered by menu and/or product name.

  • Product - the name and the variation, if any, of the product.
  • Available in Stock - the current number of items in stock. This amount is calculated in real time.
  • Increase Stock - select the plus option and insert the number of items you need to refill.
  • Decrease Stock - select the minus option and insert the number of items you need to remove.

Press the Refill button of a product to automatically calculate the number of items to add in order to restore the Default Items in Stock. For example, if a product has currently 9853 items in stock and the default number is 9999, the refill button will automatically fill the input number with the amount 146 (9999 - 9853 = 146).

Press the Refill All button to invoke the Refill action of each product in the list.

Notice that, in order to store the changes correctly, it is mandatory to press the save button.

Stocks Statistics

The Stocks Statistics page can be used to check the total number of products sold and to see a report of each product you own. All the statistics generated from this page are calculated depending on a specified dates range.

By default, the system calculates the statistics of the current month only.

It is possible to access this view from the Take-Away > Orders page, by clicking the Stocks Statistics button.

  • Product - the name and the variation, if any, of the product.
  • Products Used - the total number of items sold, within the specified dates range.
  • Report - click this button to generate 3 different graphics about this product.
    It is possible to show the graphics only for a single product per time.

The Weekdays Chart report shows the number of units sold (of the selected product) for each day of the week, within the specified dates range. For example, you can understand in which day of the week you have sold more Sesame Prawn Toast during the last 3 months.

The Months Chart report shows the number of units sold (of the selected product) for each month of the year, within the specified dates range. For example, you can understand in which month you have sold more Sesame Prawn Toast during this year.

The Years Chart report shows the number of units sold (of the selected product) for each year, within the specified dates range. For example, you can understand in which year you have sold more Sesame Prawn Toast.

If you are not able to see any graphic, these may be all the causes:

  • you forgot to press the Report button of a product
  • the selected product has never been sold within the specified dates range
  • the selected dates range is not enough wide in order to generate a graphic (e.g. a dates range of 6 months cannot display the Years Chart
Global

The Global section of VikRestaurants contains the Custom Fields, the Payment Gateways, the Media Manager and the Reservation Codes.

Custom Fields

From this page you can manage all the fields that the users will have to fill in before saving a reservation/order.

During the installation of VikRestaurants, some fields are created by the program but it is always possible to change or delete these fields.

  • Group - the group for which the custom field have to be displayed (Restaurant or Take-Away).
  • Field Name - the text to display in the label, near the input field (e.g. First Name).
    If you want to use multi language custom fields, you have to insert a code for this option (like MY_CUSTOMF_FIRST_NAME). Then you need to place the following code:
    ; this is equals to: LANG_KEY = "Translated value"
    MY_CUSTOMF_FIRST_NAME="First Name"
    
    into all your language files (admin & front):
    /administrator/language/en-GB/en-GB.com_vikrestaurants.ini
    /administrator/language/de-DE/de-DE.com_vikrestaurants.ini

    /language/en-GB/en-GB.com_vikrestaurants.ini
    /language/de-DE/de-DE.com_vikrestaurants.ini

    Since the 1.7 version of the program, the custom fields can be translated directly from the back-end of VikRestaurants.
  • Type - the type of input to use. The system supports all the following input types: Text, TextArea, Date, Select, Checkbox, Separator.
  • Required - enable this option if customers cannot skip this field. The order will be stored only when all the required custom fields will be filled-in. The label of the required options will contain the * symbol. If the custom field is used for the Take-Away group, you can decide to make the field required only if the Delivery Service is selected. For example, customers may skip the Address field in case they wanted to pickup the order at the restaurant.
  • Rule - the rule that the field must assume. The system supports all the following rules: None, Nominative, E-Mail, Phone Number, Address, Delivery.
  • Popup Link - the URL of the page you want to show as popup. By clicking on the label of the field, it will be displayed a popup containing the specified URL. It is suggested to use the &tmpl=component attribute to ignore the template and to show only the content. This option is useful for the Terms & Conditions checkboxes.

 

Below are listed all the supported types of input and how the system uses them.

 

Text Type

The Text type displays a custom HTML text input tag. It is used to receive short texts and numbers.

Field type text

Textarea Type

The TextArea type displays a custom HTML textarea tag. It is used to receive medium & long texts, thanks to the resizable right-bottom corner.

Field type textarea

Date Type

The Date type displays a custom calendar field. When the input grans the focus, it will be opened a datepicker, which it is used to pick formatted dates from the calendar.

Field type date

Select Type

The Select type displays a custom HTML select tag. The options of the dropdown can be created, sorted and translated from the management page of the custom field.

Field type select

Checkbox Type

The Checkbox type displays a custom HTML checkbox input tag. It is used to receive only true/false values (1/0 or yes/no).

Field type checkbox

Separator Type

The Separator type displays only the name of the custom field. This custom field cannot be used to receive information from the customers.
It is possible to change the style of the separator by editing the CSS rules of the class .vrseparatorcf.

 

Below are listed all the supported rules that the custom fields can own.

 

Nominative Rule

This rule is used to collect a nominative, such as First Name, Last Name or Full Name). All the Nominative custom fields will be merged together with a space in the middle. The resulting nominative will be assigned to the purchaser nominative field of the reservation.

E-Mail Rule

This rule is used to collect an e-mail address. Only one field should own this rule, otherwise only the last e-mail address specified will be considered. The resulting e-mail will be assigned to the purchaser mail field of the reservation.

Phone Number Rule

This rule is used to collect a phone number. When this rule is enabled, the system should display an additional field called Default Country Code. Inside this field, you should specify the 2 letters country code of the country in which your restaurant is located, so that the system is able to specify a default phone prefix (e.g. US for Unites States will use the +1 prefix).

Only one field should have this rule enabled, otherwise only the last phone number specified will be considered. The resulting phone number will be assigned to the purchaser phone field of the reservation.

Before to specify the phone number, customers should select the proper phone prefix by clicking the flag on the left side. If you don't want to allow your customers to select the phone prefix, you should disable the Phone Prefix Selection setting from the Global Configuration.

Address Rule

This rule is used to collect the full address for the delivery (available only for Take-Away custom fields). This field is required in order to validate the position of your customer against the delivery areas you have created from the back-end of VikRestaurants.

Only one field should have this rule enabled, otherwise only the last address specified will be considered.

In case you don't want to restrict the address of your customers, you MUST NOT use this rule.

When the customer is logged in and it owns more than one delivery address, the system will show a list of addresses that the customer can pick.

 

The Address custom field is meant to be filled-in with the following details: street name + street number + city name. If one (or more) of these information is not specified, the system may recognize a wrong address, probably not related to your country.

After filling the address, the system will validate it and it will return an appropriate message depending on the case.

  • In case the delivery address is valid, nothing will be reported.
  • In case the delivery address is valid, but it requires an additional charge, it will be displayed the example message below:
  • In case the delivery address is valid, but the total cost of the order is not enough high, it will be displayed the example error message below:
  • In case the delivery address is not valid (probably because it is missing the route or the street number), it will be displayed the error message below:
  • In case the delivery address is valid but it is not accepted for delivery, it will be displayed the error message below:
Delivery Rule

This rule is used to show/hide the custom fields depending on the type of service (delivery or pickup) that has been selected (available only for Take-Away custom fields).

For example, all the fields that should be compiled only on delivery (e.g. Address, Zip Code, Delivery Notes...) MUST own this rule.

The address rule inherits the same effect performed by the delivery rule.

Payments

The payment gateways are used to collect credit/debit cards payments from your website.

There are 2 different types of gateways: Seamless and Hosted.
With seamless payment gateways your customers won't leave your website because the credit card details will be filled through an apposite form. For this type of payment, the SSL certificate is required.
The hosted payment gateways will redirect the customers to a payment page hosted on your bank website. At the end of the transaction they will come back on your website and they will see the status of the order changed (only in case of success).

In the package you can find 3 pre-installed payment gatewaysPayPalOffline Credit CardBank Transfer.

The payment gateways will be used when the total cost of the order is higher than 0.00 and there will be at least a published gateway.

It is possible to make a payment only when the status of the order is PENDING.

  • Payment Name - the name of the payment to display in the front-end (translatable).
  • File Class - the corresponding .php file of the gateway. The file is mandatory, otherwise the system won't be able to show the payment form and to process the transaction. When you change the value from the dropdown, it will be loaded a form with the settings of the payment. All the loaded fields should be filled-in.
  • Published - disable this option if you don't want to allow customers to make payments through this gateway.
  • Cost - an additional charge/discount for this gateway. The selected amount will be displayed near the name of the payment (when it is different than 0.00). This value can be used to prevent fees or to make little discounts. When a gateway with additional cost is selected, the total cost of the order will be changed.
  • Auto-Set Order Confirmed - enable this value if you want to confirm the order by ignoring the payment transaction. This value should be enabled only for the pre-installed class bank_transfer.php.
  • Icon - an icon to show near the payment name, during the selection of the gateway. The icon can be a Font Icon to choose or an Image to upload.
  • Output Position - choosable in which position the payment form has to be displayed. This value is considering inside the Order Details page. The supported positions are Top and Bottom. Leave this field empty to ignore the Output Position and to display the form in the default position of the template.
  • Restrictions - a few restrictions to make a payment selectable only in certain cases. A payment can be always selectable or selectable only when the total cost is higher/lower than a certain amount.
  • Group - the group for which the payment has to be used (Restaurant or Take-Away). Leave this field empty to use the payment on both the sections of the program.
  • Notes Before Purchase - these notes are displayed during the selection of the payment and above the payment form in the order details page, only if the status of the order is still PENDING. This field is translatable.
  • Notes After Purchase - these notes are displayed only in the order details page, after a successful transaction (order status CONFIRMED). This field is translatable.
PayPal

The PayPal payment gateway (hosted) prints the standard orange PayPal button to start the transaction. The payment will come on PayPal website and, only after the transaction, the customers will be redirected to the order page on your website.

The parameters of PayPal require only the e-mail address assigned to your PayPal account.

If you want to test the PayPal gateway without transfer real cash, you should enable the Sandbox parameter.

Offline Credit Card

The Offline Credit Card payment gateway (seamlessis not a real method of payment. This gateway collects the credit card details of your customers in order to make the transaction with a virtual pos.

After the form submission the status of the order will be changed to CONFIRMED. If you want to leave the status as PENDING (to confirm it manually) you have to change the Default Status setting from the parameters of the gateway. From the settings of the gateway you can also choose all the accepted credit card brands.

 

For security reason, you won't be able to see all the credit card details simultaneously.

In fact, after the form submission, the system will send a notification e-mail to the administrator containing a portion of the credit card number (e.g. 4242 4242 4242 ****) and a link to see the remaining details of the credit card.

The link points to the reservations/orders page of the administrator, in which you have to click the See Credit Card button. This page contains all the following details:

  • Credit Card Brand (Visa, MasterCard, American Express, JCB, Discover, Diners Club)
  • Cardholder Name
  • Credit Card Number (stored partially, e.g. **** **** **** 4242)
  • Valid Through (month / year)
  • CVC (or CVV or CV2)

The details stored in the database are encrypted to be not visible in case of unauthorized access to the database.

Notice that the details of the credit card will be removed from the database automatically one day after the checkin of the reservation/order.

This gateway is PCI compliant.

Bank Transfer

The Bank Transfer (or Pay upon Arrival) payment gateway is used to skip the payment method process when you have other gateways published. This gateway usually means you will receive the payment by cash when the customer will come to your company.

If you want to automatically confirm the order with this payment gateway, you have to enable the Set-Auto Order Confirmed option from the parameters of the gateway (it should be already active by default).

Media Manager

The Media Manager page contains all the uploaded images, which are used from the whole program.

media is the representation of an image and its thumbnail. The original images are located in the folder:
/components/com_vikrestaurants/assets/media/
while the thumbnails are located in the folder:
/components/com_vikrestaurants/assets/media@small/

The media files can be filtered only by name.

It is not possible to use the images stored in the Joomla Media Manager, unless you re-upload them in the folders used by VikRestaurants.

Usually, you are not forced to upload a new image through the Media Manager page, because a smart dropdown (when an image can be used) will allow you to upload an image without leaving the page where you are.

New Media

To upload a new media you have to press the New button on the Joomla toolbar.

Before to upload a media, you should check the media properties to make sure it will be cropped in the right way.

  • Image - the image file to upload, located on your computer. Only images are allowed for the upload.
  • Resize Original - enable this option if you want to resize the original image.
  • Resize Width - crop the original image with the specified width (the height will be resized proportionally). The cropping is applied only if the Resize Original option is enabled.
  • Thumbnail Width - copy the image uploaded and crop it with the specified width (the height will be resized proportionally).

When you upload a new image with the same name of an existing image, it will be concatenated a random number to the name of the new one.

If you save a media without specifying a file, only the media properties will be changed.

Quick Upload

It is possible to upload multiple images in a quick way by using the Drag&Drop.

Vik Appointments - drag&drop

In the media creation page, you have to drag one or more files from your computer and drop them on the dashed gray box. All the images will be added in a queue and will be uploaded simultaneously. 

All the images will be uploaded following the specified media properties.

Vik Appointments - uploads

The images with 100% green status are successfully uploaded as media. The images with 100% blue status are completing the cropping of the thumbnail. The images with status lower than 100% are completing the upload of the original image. You can cancel the upload of an image by clicking on the Abort button. It is possible to abort an upload only when the original image hasn't been uploaded yet.

Manage Media

To manage a media you have to select the image you need to handle and to click the Edit button on the Joomla Toolbar.

From this page it is possible to rename the media and to replace the original and/or thumbnail images.

  • Name - the name of the media.
  • Action - the action to perform after saving the media. The possible actions are: do nothing, replace image, replace thumb, replace image & thumb.

The Do Nothing action won't affect the images and only the name will be updated.

The Replace Image action will replace the existing original image with the specified one.

The Replace Thumb action will replace the existing thumbnail image with the specified one.

The Replace Image & Thumb action will replace both the images related to this media. In this case, you will have to specify the media properties you need to use.

If an image doesn't own a thumbnail image, you should download the original image and use the Replace Image & Thumb action in order to re-create the thumbnail.

Reservation Codes

The reservation codes can be used to improve the reservation management. They will never affect the duration of a reservation/order.

For the Take-Away, the reservation codes can be used to create a status history of the orders, which the customers can check. For example, "the order is in preparation" or "the order has been delivered".

  • Code - the name of the code.
  • Icon - the icon of the code. If no icon will be specified, only the name will be displayed.
  • Group - the group of the code. A code can be used only for the restaurant reservations or for the take-away orders.
  • Notes - a short description of the reservation code. This text is seen from the customers to check the status of their orders.
Configuration

Here are listed all the possible settings that can affect the program to work in different ways.

The Renew Session button should be used (strongly recommended) every time you change something from the configuration (after pressing the Save button). This is needed to refresh the settings stored in the PHP session of the active users on your website. If you don't press this button, probably you won't see the changes in the front-end of your website.

The new settings will be immediately available for all the future users and will be available for the active users after 15 minutes of inactivity.

Global Configuration

In the Global configuration of the program is possible to define all the generic parameters to fit the system to your needs.

System

Restaurant Name
The name of your restaurant, displayed in the e-mail contents and subjects, in the sms and in the ICS sync.

Company Logo
The image logo of your company. The image logo is used from the e-mail templates and from the invoice template. If you don't need to use a logo, leave it empty so that it won't be displayed.

Enable Restaurant
Check this option to manage the Restaurant section of the program and to receive online reservations. When this option is disabled, the features of the restaurant will be hidden also from the back-end.

Enable Take-Away
Check this option to manage the Take-Away section of the program and to receive online orders. When this option is disabled, the features of the take-away will be hidden also from the back-end.

Date Format
The format of the date to display in the back-end and in the front-end. The available formats are Y/m/d, m/d/Y, d/m/Y, Y-m-d, m-d-Y, d-m-Y, Y.m.d, m.d.Y and d.m.Y.

Time Format
The format of the time to display in the back-end and in the front-end. The time can be formatted in 12 hours (am/pm) or 24 hours.

Opening Time Mode
This setting is used to generate the available times for the reservations. When it is set to Shifted, the Working Shifts will be used. When this option is set to Continuous, it is required to specify a From Hour and a To Hour. It is required to use working shifts when the opening times of your restaurant are separated (e.g. 12:00 - 14:00 and 18:30 - 23:00).

Enable Multilanguage
This option should be enabled when the contents of your website (menus, take-away menus, toppings, deals and so on) must be translated in different languages. When this option is enabled, the system will show some flags, referring to the available translations, near each item. If you don't want to translate the contents, but only the text of the program, you can disable this option and only use the translated language files.

Enable Phone Prefix
Disable this setting if you don't want to display the phone prefix dropdown next to the Phone Number custom fields.

Dashboard Refresh Time
Set the seconds to refresh the upcoming orders in the dashboard view. In this way, every X seconds, the system will search automatically for new orders. This value shouldn't be lower than 15 seconds.

Checkbox Style
Use a different style for the checkboxes (Yes/no) in the back-end. The possible styles are: Toggle and Joomla.

Load jQuery
jQuery is required to the system to perform certain actions via javascript. If your template already loads jQuery, you can disable this setting.

Google Maps API Key
Specify here your Google Maps API Key in order to use correctly the Take-Away Delivery Areas and the Take-Away Map module. It is strongly recommended to fill this field.
If you haven't obtained yet an API Key, you can get it from here: https://developers.google.com/maps/documentation/javascript/get-api-key

Display Footer
Disable this option if you don't want to show the e4j credits on the bottom of the pages in the administrator.

Current Default Timezone
This setting shows only the timezone that will be used from the extension. If you think it is not correct, it means that you should change it from the configuration of your server.

E-mail

Admin e-Mail
The e-mail address of the administrator. All the notifications, including the reservations received, will be sent to this address.
If you want to notify multiple addresses, you have just to specify them separated by a comma: This email address is being protected from spambots. You need JavaScript enabled to view it., This email address is being protected from spambots. You need JavaScript enabled to view it., This email address is being protected from spambots. You need JavaScript enabled to view it..

Sender e-Mail
The e-mail address used as sender for all the e-mails of VikRestaurants. If you don't specify this e-mail address, it will be used the first address specified in the Admin e-Mail parameter.

Currency

Currency Symbol
Insert here the symbol (or some characters) of the currency used in your system (like €, $, £ and so on). This value will be displayed next to the prices on your website.

Currency Name
Insert here the standard 3 letters code of the currency used in your system (like EUR, USD, GBP and so on). The value specified must be a standard of the ISO 4217.

Symb Position
Choose from this setting the position of your currency symbol: after the price (12.50 €) or before the price (€ 12.50).

Decimal Separator
The symbol used to separate the integer part from the fractional part of a price, like € 120.00 or € 120,00.

Thousands Separator
The symbol used for the digit grouping, like € 1.000,00 or € 1,000.00.

Number of Decimals
The number of decimals to display for the fractional part of a price, like € 280.0 or € 280.00.

Reviews

Enable Reviews
Check this setting if you want to enable the Reviews system.

Take-Away Reviews
Enable this option to receive reviews for your Take-Away Products.

Reviews Allowed To
Specify who will be able to leave the review. The possible options are:

  • Anyone - anyone is able to leave reviews
  • Only Logged-in Users - only a logged-in customer will be able to leave reviews
  • Verified Purchasers - only a logged-in customer that has purchased the item will be able to leave the review for that item.

The system won't allow a user to leave a review twice for the same item, only if it is possible to recognize the user. For this reason, it is discouraged the usage of the Anyone option in order to avoid SPAM and FAKE reviews.

Comment Required
Enable this option to force the users to leave a comment. Otherwise only the title and the rating will be mandatory.

Comment Min. Length
Even if the comment is not required, if a user starts typing something, it must write a number of characters at least equals to the specified amount.

Comment Max. Length
The maximum number of characters that a comment can reach.

List Limit
The maximum number of reviews to display per time. There is an apposite button to load the remaining reviews, if any.

New Auto-Published
Enable this option to automatically approve (publish) all the new reviews. Otherwise it will be required a manual approval in order to display a review to the customers.

Filter by Language
Enable this option to automatically filter the reviews by language. When this option is enabled, an English customer will never see a review left in Italian.

Closing Days

Define the days on which your Restaurant is closed. These dates won't be selectable during the booking process of both the sections of the program: Restaurant and Take-Away.

After picking a closing day, it is possible to specify the frequency of this closure, which can be one of the following: weekly (e.g. every Monday), monthly (e.g. the 1st of every month), yearly (e.g. every Christmas) and single day (e.g. only 21st November 2017).

Restaurant Configuration

In the Restaurant configuration of the program is possible to define all the parameters to build the availability system of your restaurant.

Restaurant

Display on Dashboard
Enable this option to show the Restaurant reservations in the Dashboard page.

Minutes Intervals
The minutes of the working shifts will follow the interval specified from this parameter. The possible options are: 10, 15, 30, 60 minutes.
When the interval is set to 30 minutes, it will be generated the following dropdown: 19:00, 19:30, 20:00, 20:30...

Average Time of Stay
This is an important setting for the availability calculation of the tables at certain dates and times. In a few words, this setting represents the duration of each reservation you have. The value must be expressed in minutes (by default it is set to 60) and, for example, a table reserved for Today at 8 PM will be again available at 9 PM. From the details page of a reservation you can decide to increase/decrease its own time of stay.

Booking Minutes Restrictions
The program will accept reservations starting from TOT minutes after the current time. In a few words, when this values is set to 120, customers have to book a reservation/order 2 hours in advance.

Deposit per Reservation
Define the amount to be left as deposit for each reservation. Leave it empty or set it to 0.00 to not ask for a deposit. When this value is set to 0.00, reservations will be confirmed automatically or through manual approval.

Deposit per Person
Choose whether the amount to be left as deposit should be multiplied by the number of the participants.

Choosable Menus
Enable this option if you want to allow customers to pre-select a menu in the Search step of the booking process.

Default Status
If you are not using the payment gateways or the deposit amount is set to 0.00, the new reservations will have the status equals to this setting (CONFIRMED or PENDING).

Keep Tables Locked For
This setting is used to calculate if a table is available for the reservation or not. In case you are using the program with a Deposit to be left, the saved reservation will have a certain status (given by the configuration of the payment method chosen). When the status is Pending, it means that the reservation needs to be paid (or accepted manually from the administrator section) in order to become Confirmed. This setting defines the number of minutes for which the system should keep the tables of a Pending Reservation, as locked so that nobody can choose a table that is being reserved by another client.

Enable Cancellation
Enable this value if you want to allow your customers to cancel their CONFIRMED reservations by themselves from the order details page. When a customer cancels a reservation, the administrator(s) and the customer will receive a notification e-mail.

Cancellation Reason
Choose if the customers have to specify a reason before to cancel a reservation. The possible options are: Never, Optional, Always Required.

Accept Cancellation Before
Restrict the order cancellation by setting a minimum number of days. In this way customers can cancel their reservations only X days in advance.

Login Requirements
Set this value to Required if you want to force your customers to login/register before to proceed with the checkout. The custom fields of the customers will be stored (only when logged-in) and automatically filled-in starting from the second purchase. The information specified in the registration fields won't be used for custom fields. When this value is set to Never, VikRestaurants won't remember the custom fields of logged in users. Choose the Possible option (recommended) to allow the customers to proceed with the checkout as guests or as logged users.

Enable User Registration
This parameter is available only if the Login Requirements setting is not set to Never. If this field is enabled, users can register themselves automatically in your Joomla site.

The default Joomla Registration settings will be used.

Search

Reservation Requirements
This option is required to allow customers to choose something during the booking process.
It is possible to choose a Room/Area and a related Table, choose only a Room/Area or not letting the users choose anything.

Minimum People
Defines the global minimum number of people that can be accepted. By default it is set to 2.

Maximum People
Defines the global maximum number of people that can be accepted. By default it is set to 20.

Show Large Party Label
When this option is enabled it will be displayed the label - MORE - as last option of the people dropdown. This option is helpful when you don't have a table that can host large parties. By clicking on this option, customers will be automatically redirected into a specified URL.

Large Party URL
Specify the URL on which the customers will be redirected after clicking the - MORE - label.

Apply Percentage Coupons to
The percentage coupon can be applied to the deposit or to the bill value of a reservation.

Taxes

Taxes Ratio
The percentage taxes amount of your country. This setting is used to calculate the taxes amount of the total bill during the generation of the restaurant invoices.

Use Taxes
Specify if the taxes have to be summed to the total bill (excluded) or if they have to be detracted (included).

E-mail

Send to Customers with Order
Set the value to Only Confirmed if you want to send the confirmation e-mail to the customers only when the status of the reservation is confirmed.

Send to Operators with Order
Set the value to Only Confirmed if you want to send the notification e-mail to the operators only when the status of the reservation is confirmed.

Send to Admin with Order
Set the value to Only Confirmed if you want to send the notification e-mail to the administrator(s) only when the status of the reservation is confirmed.

Customer E-Mail Template
The HTML template to use to build the content of the e-mail that the customers receive for new bookings. You can change the HTML content of the e-mail for the customers by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/mail_tmpls/.

Admin E-Mail Template
The HTML template to use to build the content of the e-mail that the administrators receive for new bookings. You can change the HTML content of the e-mail for the administrators by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/mail_tmpls/.

Cancellation E-Mail Template
The HTML template to use to build the content of the e-mail that the administrators receive for bookings cancellation. You can change the HTML content of the e-mail for the administrators by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/mail_tmpls/.

Columns in Reservations List

You can specify from this setting all the columns that you want to display/hide in the Restaurant > Reservations page in the back-end. The available columns are: Order Number, Order Key, Payment, Checkin, People, Table, Customer Name, (Customer) E-Mail, (Customer) Phone Number, Order Info, Coupon, Deposit, Bill Value, Bill Closed, (Reservation) Code and Status.

Take-Away Configuration

In the Take-Away configuration of the program is possible to define all the parameters to build the availability system of your takeaway business.

Reservation

Default Status
If you are not using the payment gateways, the orders will have the status as this setting (CONFIRMED, PENDING).

Enable Cancellation
Enable this value if you want to allow your customers to cancel their CONFIRMED orders by themselves from the order details page. When a customer cancels an order, the administrator(s) and the customer will receive a notification e-mail.

Cancellation Reason
Choose if the customers have to specify a reason before to cancel an order. The possible options are: NeverOptionalAlways Required.

Accept Cancellation Before
Restrict the order cancellation by setting a minimum number of days. In this way customers can cancel their orders only X days in advance.

Minutes Intervals
The minutes of the working shifts will follow the interval specified from this parameter. The possible options are: 10153060 minutes.
When the interval is set (for example) to 30 minutes, it will be generated the following dropdown: 19:00, 19:30, 20:00, 20:30...

Soonest Delivery
This parameter is used to calculate the very first available time starting from the current time. The accepted options vary from the selected Minutes Intervals.
For example, if we select 60 minutes option and the current time is 7:00 pm, the soonest delivery will be @ 8:00 pm (7:00 pm + 60 minutes).

Keep Orders Locked for
This setting is used to calculate if a take-away order is available for reservation or not. In case you are using the program with a Deposit to be left, the saved order will have a certain Status (given by the configuration of the payment method chosen). When the Status is Pending, it means that the reservation needs to be paid (or accepted manually from the administrator section) in order to become Confirmed. This setting defines the number of minutes for which the system should keep the order of a Pending Reservation as "locked".

Login Requirements
Set this value to Required if you want to force your customers to login/register before to proceed with the checkout. The custom fields of the customers will be stored (only when logged-in) and automatically filled-in starting from the second purchase. The information specified in the registration fields won't be used for custom fields. When this value is set to Never, VikRestaurants won't remember the custom fields of logged in users. Choose the Possible option (recommended) to allow the customers to proceed with the checkout as guests or as logged users.

Enable User Registration
This parameter is available only if the Login Requirements setting is not set to Never. If this field is enabled, users can register themselves automatically in your Joomla site.

The default Joomla Registration settings will be used.

Order

Min Cost per Order
This is the minimum cost per order. It means that, to confirm an order, the total cost in the cart MUST be equals or higher than the specified amount.

Meals per Interval
The maximum number of meals that your restaurant can prepare in a single interval (No Preparation meals are not counted). This is the main setting for the availability calculation of takeaway order.
For example, if you can handle 15 (preparation) items per interval and you have currently 10 items to prepare @ 7:00 pm, an order with 6 preparation item won't be able to select the delivery time at 7:00 pm (because 10 + 6 > 15).

Max Meals in Cart
The maximum number of meals to prepare that can be purchased in the same order. The No Preparation items (such as cans or beverages) won't be counted.

Use Items Overlay
Select in which case the overlay has to be used after clicking the ADD button to pick a food from the list. The possible cases are: Always, Only with toppings available, Never.

Allow Date Selection
When this parameter is disabled, the orders can be placed only for the current day.

Live Orders
Enable this option to allow the customers to order only if the restaurant is currently open. This option is visible only if the Allow Date Selection setting is disabled.

Delivery

Delivery Service
From this setting you can decide if your restaurant supports only the Delivery service, only the Pickup service or both.

Delivery Cost
Only if the delivery service is allowed, you can define here the base cost for the delivery. It can be a fixed value or a percentage value calculated on the total cost of the order. Notice that the charge of the delivery areas will be always summed to this value.

Free Delivery With
When the total cost of an order reaches this value, the delivery service cost will be free. If you want to disable this option you should set it to an unreachable value (e.g. 99999999).

Pickup Cost/Discount
Only if the pickup service is allowed, you can define here an additional cost or a discount for the pickup. It can be a fixed value or a percentage value calculated on the total cost of the order.

Stocks

Enable Stocks System
Enable this option to use the whole Stocks system. Otherwise the products you have will be always available.

Stocks E-Mail Template
The HTML template to use to build the content of the e-mail that the administrators receive when the stocks of certain items are too low. You can change the HTML content of the e-mail for the administrators by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/tk_mail_tmpls/.

Taxes

Taxes Ratio
The percentage taxes amount of your country. This value is used to calculate the taxes of the take-away orders.

Use Taxes
Specify if the taxes have to be summed to the total cost (excluded) or if they have to be detracted (included).

Show Taxes
Enable this parameter to show the taxes label in the summary cart of the take-away confirmation page.

Take-Away

Show Products Image
Enable this option to display the images, if any, into the Take-Away Menus List page of VikRestaurants.

Confirmation Page Item ID
Specify an Item ID to use for the Take-Away Confirmation page. You can specify an existing menu item or a custom ID.

This setting is useful to hide the Cart module, if you have assigned it to the previous page, from the confirmation page.

Products Description Length
The maximum number of characters to display for the description of the products (Take-Away Menus List page). When the length of the description is higher than this amount, it will be placed a READ MORE button to show the whole text.

Front Notes
The Front Notes are displayed at the beginning of the Take-Away Menus List page. In this field you can write useful information about the booking process.

Origin Addresses

The Origin Addresses are used to calculate the distance and the delivery time between you restaurant position and the address of your customers.

Just click the Add New Origin button and fill-in the full address of your restaurant.

E-mail

Send to Customers with Order
Set the value to Only Confirmed if you want to send the confirmation e-mail to the customers only when the status of the order is confirmed.

Send to Operators with Order
Set the value to Only Confirmed if you want to send the notification e-mail to the operators only when the status of the order is confirmed.

Send to Admin with Order
Set the value to Only Confirmed if you want to send the notification e-mail to the administrator(s) only when the status of the order is confirmed.

Customer E-Mail Template
The HTML template to use to build the content of the e-mail that the customers receive for new take-away orders. You can change the HTML content of the e-mail for the customers by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/tk_mail_tmpls/.

Admin E-Mail Template
The HTML template to use to build the content of the e-mail that the administrators receive for new take-away orders. You can change the HTML content of the e-mail for the administrators by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/tk_mail_tmpls/.

Cancellation E-Mail Template
The HTML template to use to build the content of the e-mail that the administrators receive for take-away orders cancellation. You can change the HTML content of the e-mail for the administrators by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/tk_mail_tmpls/.

Prod Review E-Mail Template
The HTML template to use to build the content of the e-mail that the administrators receive for take-away reviews. You can change the HTML content of the e-mail for the administrators by clicking the Edit button near the dropdown. It is possible to use only one template per time. You can save the template as copy so that you won't lose the original code. The e-mail template files are located in the folder /components/com_vikrestaurants/helpers/tk_mail_tmpls/.

Columns in Orders List

You can specify from this setting all the columns that you want to display/hide in the Take-Away > Orders page in the back-end. The available columns are: Order Number, Order Key, Payment, Checkin, Delivery Service, Customer (Name), (Customer) E-Mail, (Customer) Phone Number, Order Info, Coupon, Total To Pay, Taxes, (Reservation) Code and Status.

SMS APIs Configuration

The SMS APIs configuration is used to configure the APIs settings of your provider to be able to send SMS manually and/or automatically through your system.

SMS API File
Select the .php file of the SMS provider you want to use.

Send SMS for
Choose for which section the SMS have to be send automatically. The possible options are: Restaurant, Take-Away, Restaurant & Take-Away or Only Manual.

Send SMS to
Choose which entity can receive the SMS sent automatically. The possible options are: Customer, Administrator or Customer & Administrator.

Phone Number
Specify here the phone number of the administrator that can receive the SMS. Remember to specify also the right prefix from the apposite dropdown. Only one administrator can be notified.

User Credit
If the selected gateway supports the Estimate Credit function, it will be displayed a button to evaluate the remaining credit of your account. This button may be visible only after saving the configuration.

Parameters

Every time you change file from the SMS API File setting, the system will load here all the parameters related to the selected gateway.

All the listed parameters should be filled in.

Customer SMS Template

From this form you can compose the content of the SMS to send to the customers. If you want to insert some details about the reservation you can click on the buttons above the textarea (it will be inserted a code which will be replaced with the relative value of the reservation).

It is possible to create a content for the SMS relative to the restaurant reservations and to the takeaway orders. To switch the content of the sms you have to press the button on the left side below the textarea.

All the SMS contents can be translated in different languages by clicking on the apposite language buttons on the right side below the textarea. These buttons will be available only when the Multilanguage option is enabled. The available languages will be retrieved from the Language Manager of your Joomla.

Administrator SMS Template

From this form you can compose the content of the SMS to send to the administrator. If you want to insert some details about the reservation you can click on the buttons above the textarea (it will be inserted a code which will be replaced with the relative value of the reservation).

It is possible to create a content for the SMS relative to the restaurant reservations and to the takeaway orders. To switch the content of the sms you have to press the button on the left side below the textarea.

Applications Configuration

The Applications configuration is used to configure the settings related to all the external applications which are communicating with your VikRestaurants.

Framework APIs

Enable APIs
Enable this setting if you want to connect external applications to your website. The connection is allowed only if the credentials of the client are valid.

If this option is disabled, any connection attempt will be denied.

Max Failure Attempts
Every time a client fails the login to your system, its failure attempts number is increased by one. When the number of attempts reaches this value, the calling IP Address will be automatically (and permanently) banned.

Register Logs
Choose the way for which the system should log the messages. It is possible to log only anything or to log only the errors. Otherwise it is possible to completely disable the logs.

Auto-Flush Logs
You can allow the system to remove the logs automatically after some time. The possible options are: Every Day, Every Week, Every Month, Never.

Applications
Click this button to see all the applications able to communicate with your system.

Plugins
Click this button to see all the plugins that can be performed/launched by the external applications.

Development APIs

Here you can understand how to integrate a customized payment gateway or a SMS provider for VikRestaurants.

Take a look HERE to understand and handle the APIs of VikRestaurants.

How to develop a payment processor

The payment framework of VikRestaurants can be extended by creating a PHP file declaring the VikRestaurantsPayment class.
The created file must be placed via FTP onto the /administrator/components/com_vikrestaurants/payments/ directory.

In order to develop the class VikRestaurantsPayment please follow the example code below.

<?php

defined('_JEXEC') OR die('Restricted Area');

class VikRestaurantsPayment
{	
	private $order_info;
	private $params;
	
	public static function getAdminParameters()
	{
		return array();
	}
	
	public function __construct($order, $params = array())
	{
		$this->order_info = $order;
		$this->params = $params;
	}
	
	public function showPayment()
	{
		/** See the code below to build this method */
	}
	
	public function validatePayment()
	{
		/** See the code below to build this method */
		return array();

	}

	public function afterValidation($esit = 0)
	{
		/** See the code below to build this method */
	}
}
Parameters Building

The parameters form for the administrator section can be built through the getAdminParameters() static method. This is useful to fill in private data or credentials, required for the creation and the validation of the payment/transaction.

A Merchant ID and a Signature Key are an example of parameters that should be visible as well as editable in the back-end.

The parameters of the form are returned as an array with the following structure:

{
	"param_1" : {
		"label" : "Label 1",
		"type" 	: "text"
	},
	"param_2" : {
		"label"   : "Label 2",
		"type" 	  : "select",
		"default" : 1,
		"options" : {
			"1" : "Yes",
			"0" : "No"
		}
	},
	"param_3" : {
		"label"    : "Label 3",
		"type" 	   : "select",
		"multiple" : 1,
		"options"  : [1, 2, 3]
	}
}
  • param_1 - the associative key of the array that must be unique (required).
    It is used to get the parameter value from the configuration array.

  • label - the text label of the parameter in the administrator section (optional).
    By placing a double slash (//) after the label, the next text will be displayed as a tip (like "Merchant ID//this is a tip to display...").
  • type - used to render the right type of input field in the administrator section (required).
    The values allowed for the type are: customselecttext or password.
  • html - will be used only when the type of the parameter is custom (optional).
  • options - an array containing all the possible values to use in the dropdown (required only when the type is select).
    The array may contain associative keys.
  • default - the default value to use/set.
  • multiple - set the value 1 if it is possible to choose more than one option (considered only when the type is select).
public static function getAdminParameters()
{
	$logo_img = JURI::root().'administrator/components/com_vikrestaurants/payments/mypay/mypay-logo.jpg';
	
	return array(	
		'logo' => array(
			'label' => '',
			'type' => 'custom',
			'html' => '<img src="'.$logo_img.'"/>'
		),
		'merchantid' => array(
			'label' => 'Merchant ID',
			'type' => 'text'
		),
		'testmode' => array(
			'label' => 'Test Mode',
			'type' => 'select',
			'options' => array('Yes', 'No'),
		),
	);
}

The code above will generate a parameters form, in the administrator section, as follows.
Vik Restaurants - Payment processor
If your form doesn't come up, probably there is a syntax error on your file.
When you fill in the admin form, the parameters are stored in the $params (array) property of the class, so that you are able to get the values with the instructions below:

$merchant_id = $this->params['merchantid']; /* returns "539264823539" */
$test = $this->params['testmode']; /* returns "Yes" */
Order Info Object

The $order_info property is an associative array containing the order information needed to complete the payment process. You can see below all the available keys of the array.

ParamTypeDescription
oid integer Is the unique ID of the reservation.
sid alphanumeric(16) Is the Order Key of the reservation.
tid tinyint(1) The type of the order, 0 for restaurant reservations or 1 for take-away orders. 
transaction_currency char(3) The currency of the amount (3-letter ISO 4217 code). The default is EUR.
return_url string The return url to come back to your shop from the bank on successful transactions.
error_url string The error url to come back to your shop from the bank on failed transactions.
notify_url string The notification url to validate the transaction data sent from the bank. This URL invokes the validatePayment method of your gateway.
total_to_pay decimal The total amount to pay as decimal (ex. 135.50).
details array The customer details stored in the order. The available fields are purchaser_mailpurchaser_phonepurchaser_nominative.

You can retrieve the information from the $order_info property with the example code below.

$uniq_id = $this->order_info['oid']."-".$this->order_info['sid'];
Show Payment

The method showPayment() of the object VikRestaurantsPayment is invoked every time a user visits the page of a reservation with PENDING Status. Here you need to echo the HTML form that points to the payment creation url of your bank gateway.

In this method it is possible also to make calls via cURL (or something else) to retrieve tokens or to self submit the form to receive additional info that are required for the gateway.

public function showPayment()
{	
	$merchant_id = $this->params['merchantid'];
	
	$action_url = "https://yourbankgateway.com/";
	if ($this->params['testmode'] == 'Yes') {
		$action_url = "https://test.yourbankgateway.com/";
	}

	$form = '<form action="'.$action_url.'" method="post">';
	// put here all the required fields of your gateway
	$form .= '<input type="hidden" name="your_post_data_merchantid" value="'.$merchant_id.'"/>';
	$form .= '<input type="hidden" name="your_post_data_amount" value="'.$this->order_info['total_to_pay'].'"/>';
	$form .= '<input type="hidden" name="your_post_data_notifyurl" value="'.$this->order_info['notify_url'].'"/>';
	$form .= '<input type="hidden" name="your_post_data_description" value="'.$this->order_info['transaction_name'].'"/>';
	// print a button to submit the payment form
	$form .= '<input type="submit" name="_submit" value="Pay Now!" />';
	$form .= '</form>';
	
	echo $form;
}
Validate Payment

The validatePayment() method is used to validate the transaction details sent from the bank. This method is invoked by the system every time the Notify URL is visited (the one described in the showPayment() method). Usually the data are sent via POST method, and you can access them by simply using the $_POST super-global variable.

Some gateways require a signature validation to make sure the transaction wasn't corrupted. The signature validation can be created only following the instructions on the official documentation of your bank.

This method must return an associative array with the status of the transaction. The possible keys of the array are the following.

ParamTypeDescription
verified boolean The status of the transaction. 1/true in case of success, otherwise 0/false.
tot_paid decimal The real amount paid from the customer (eg 102.75).
log string A log message sent to the administrator in case of transaction failed. The log can contain any value returned from the Bank and it should be as specific as possible.

You can pass any other value in the array, but they will be completely ignored during the validation of the transaction.

public function validatePayment()
{
	$array_result = array();
	$array_result['verified'] = 0;
	$array_result['tot_paid'] = ''; /** This value will be stored in the DB */
	
	/** In case of error the log will be sent via email to the admin */
	
	$status = $_POST['status'];
	/** Process your gateway response here */
	if ($status == 'success') {
		$array_result['verified'] = 1;
		/** Set a value for $array_result['tot_paid'] */
		$array_result['tot_paid'] = $_POST['amount'];
	} else {
		$array_result['log'] = "Transaction Error!\n".$_POST['error_msg'];
	}
	
	/** Return the array to VikRestaurants */
	return $array_result;
}
After Validation

The afterValidation($esit) method is optional and it is generally used to display a message and to redirect the gateway to the order summary view in case of success or failure. Notice that this method should be used from your class only in case the Bank Gateway will not redirect the user to the Return URL.

The $esit argument is a boolean value that represents the status of the transaction. In case of success (1/true) you should print a positive message and redirect the gateway to the return_url address, otherwise (0/false) you should print an error message and redirect the gateway to the error_url address. Remember also to put an exit or die rule at the end of the method to completely stop the flow.

When this method is available, it will be invoked by the system once validatePayment() has been performed.

public function afterValidation($esit = 0)
{	
	$app = JFactory::getApplication();
	
	if ($esit < 1) {
		$app->enqueueMessage('The payment was not verified, please try again.', 'error');
		$app->redirect($this->order_info['error_url']);
	} else {
		$app->enqueueMessage('Thank you! The payment was verified successfully.');
		$app->redirect($this->order_info['return_url']);
	}
	
	exit;
}

You can get HERE the complete code of this example gateway.

How to develop a SMS gateway

The SMS gateways for VikRestaurants can be extended by creating a PHP file containing the VikSmsApi class.
The created file have to be placed via FTP in the directory: /administrator/components/com_vikrestaurants/smsapi/
To develop the class VikSmsApi you need to follow the code below.

<?php

defined('_JEXEC') OR die('Restricted Area');

class VikSmsApi
{	
	private $order_info;
	private $params;
	private $log = '';
	
	public static function getAdminParameters()
	{
		return array();
	}
	
	public function __construct($order, $params = array())
	{
		$this->order_info = $order;
		$this->params = !empty($params) ? $params : $this->params;
	}

	public function sendMessage($phone_number, $msg_text)
	{
		/** See the code below to build this method */
		return new stdClass;
	}
	
	public function estimate($phone_number, $msg_text)
	{
		/** See the code below to build this method */
		return new stdClass;
	}
	
	public function validateResponse($response_obj)
	{
		/** See the code below to build this method */
		return true;
	}
	
	public function getLog()
	{
		return $this->log;
	}	
}
Parameters Building

The parameters form for the administrator can be built through the getAdminParameters() static method, to fill in private data required to the creation and validation of the payment, like API Key and API Secret.
The parameters of the form are returned as an array with the following structure:

{
	"param_1" : {
		"label" : "Label 1",
		"type" 	: "text"
	},
	"param_2" : {
		"label" : "Label 2",
		"type" 	: "select"
	}
}
  • param_1 is the key of the array and have to be unique (required).
    It represents the name of the parameter to use.

  • label indicates the text to assign for the parameter in the administrator section (optional).
    By placing a double slash (//) after the label, the next text will be displayed as a tip near the field of the parameter (like "Sender//max 11 characters").
  • type is used to render the right type of input in the administrator section (required).
    The accept type must be one of the following: customselecttext.
  • html will be used only when the type of the parameter is custom (optional).
  • options is an array containing all the possible values to use in the dropdown (required only when the type is select).
public static function getAdminParameters()
{
	return array(	
		'apikey' => array(
			'label' => 'API Key',
			'type' => 'text',
		),
		'apisecret' => array(
			'label' => 'API Secret',
			'type' => 'text',
		),
		'sender' => array(
			'label' => 'Sender Name//max 11 characters',
			'type' => 'text',
		),
		'sandbox' => array(
			'label' => 'Sandbox',
			'type' => 'select',
			'options' => array('NO', 'YES'),
		),
	);
}

The code above will generate a parameters form in the administrator section as follows.

If your form doesn't come up, probably there is a syntax error on your file.
When you fill in the admin form, the parameters are stored in the array $params and you are able to get the values with the instructions below:

$api_key = $this->params['apikey']; /* returns "TS8KJSGV20E7SG2K" */
$api_secret = $this->params['apisecret']; /* returns "ks03bsoaqsdlew83hdswlsn2ie7d2hndmwq" */
$sender_name = $this->params['sender']; /* returns "e4j.com" */
$sandbox = $this->params['sandbox']; /* returns "NO" */
Send Message

The method sendMessage($phone_number, $msg_text) of the object VikSmsApi is invoked every time an order becomes CONFIRMED, like after a payment. Here you have to post the details of your account, the phone number of the customer and the message to send through the gateway of your provider. Generally you need to post these fields via cURL to a certain end-point provided from your gateway.

The sendMessage function requires 2 arguments:

  • $phone_number - (string) the phone number of the customer. This value have to be validate before to send the message, because it could not contain the prefix or could contain unrecognized characters (like @ or / and so on) 
  • $msg_text - (string) the full text to send to the customer. A lot of providers allow to send only 160 characters per message, so you should consider this limitation.

The code below is only an example how it should work a cURL connection to the gateway of the provider.

public function sendMessage($phone_number, $msg_text)
{
	$phone_number = $this->sanitizePhoneNumber($phone_number);
	
	if ($this->params['sandbox'] == "NO") {
		$this->params['sandbox'] = 0;
	} else {
		$this->params['sandbox'] = 1;
	}
	
	$request = array(
		"apikey" => $this->params['apikey'],
		"apisecret" => $this->params['apisecret'],
		"from" => $this->params['sender'],
		"to" => $phone_number,
		"msg" => $msg_text,
		"sandbox" => $this->params['sandbox'],
	);
	
	$json = json_encode($request);

	$curl_opts = array(
		CURLOPT_POST => true,
		CURLOPT_POSTFIELDS => $json,
		CURLOPT_RETURNTRANSFER => true,
		CURLOPT_HTTPHEADER => array(
			'Accept: application/json',
			'Content-Type: application/json;charset=UTF-8',
			'Content-Length: '.strlen($json),
		),
	);

	$ch = curl_init('https://secure.sms.fakeprovider.com/send');
	curl_setopt_array($ch, $curl_opts);
	$response = curl_exec($ch);

	return json_decode($response);
}
Sanitize Phone Number

The sanitizePhoneNumber function used above is not a native function of the VikSmsApi class, so you have to write this method on your code.

Here you can find a simple code to sanitize a phone number.

protected function sanitizePhoneNumber($phone_number)
{
	$str = '';
	for ($i = 0; $i < strlen($phone_number); $i++) {
		if (($phone_number[$i] >= '0' && $phone_number[$i] <= '9') || $phone_number[$i] == '+') {
			$str .= $phone_number[$i]; // copy only numbers and plus character
		}
	}
	
	$default_prefix = '+1'; // US, Canada phone prefix
	
	if ($phone_number[0] != '+') { 
		// $phone_number doesn't contain the phone prefix 
		$str = $default_prefix.$str;
	}
	
	return $str;
}
Validate Response

The validateResponse($response_obj) method is used to validate the object returned from the gateway during the sending of the message. Some gateways return an object containing a short error message and the http status code.

{
	"httpcode" : 200,
	"errmsg" : ""
}
{
	"httpcode" : 401,
	"errmsg" : "BAD_CREDENTIALS"
}
{
	"httpcode" : 402,
	"errmsg" : "BAD_CREDIT"
}

While, sometimes, the object returned is a simple boolean value (true/false).

In this method you have to return only a boolean value to communicate to the program the status of the message. With TRUE status, nothing will be notified, otherwise an error e-mail will be sent to the administrator containing the text in the $log attribute.

public function validateResponse($response_obj)
{
	if ($response_obj->httpcode == 200) {
		return true;
	}
	
	$this->log .= $response_obj->errmsg;
	return false;
}
Estimate Credit

The estimate($phone_number, $msg_text) is an optional method used to retrieve the remaining credit from the back-end of the program. A lot of providers don't have an API call to retrieve the credit of a certain account, so you can decide to skip this method.
$phone_number and $msg_text are only used as example from the gateway.

The returned value from this function have to be an object containing the errCode and userCredit attributes:

{
	"errCode" : 0, // no errors
	"userCredit" : 85.47 // in decimals
}

Generally the estimate function is similar to the sendMessage function, but it makes a call to a different gateway of the provider.

public function estimate($phone_number, $msg_text)
{
	$phone_number = $this->sanitizePhoneNumber($phone_number);
	
	$request = array(
		"apikey" => $this->params['apikey'],
		"apisecret" => $this->params['apisecret'],
		"from" => $this->params['sender'],
		"to" => $phone_number,
		"msg" => $msg_text,
	);
	
	$json = json_encode($request);

	$curl_opts = array(
		CURLOPT_POST => true,
		CURLOPT_POSTFIELDS => $json,
		CURLOPT_RETURNTRANSFER => true,
		CURLOPT_HTTPHEADER => array(
			'Accept: application/json',
			'Content-Type: application/json;charset=UTF-8',
			'Content-Length: '.strlen($json),
		),
	);
 
	$ch = curl_init('https://secure.sms.fakeprovider.com/estimate');
	curl_setopt_array($ch, $curl_opts);
	$response = curl_exec($ch);
	$response = json_decode($response);

	$fixedResponse = new stdClass;
	$fixedResponse->errCode = $response->httpcode; 
	$fixedResponse->userCredit = 0.0;

	if ($fixedResponse->errCode == 200) {
		$fixedResponse->errCode = 0;
		$fixedResponse->userCredit = $response->credit;
	}

	return $fixedResponse;
}

The code above will generate automatically a button in the configuration of the program to estimate the remaining credit.

You can get HERE the complete code of this example gateway.

Tutorials

Extensionsforjoomla.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
E4J s.r.l. - VAT N. 06794860483

This site uses cookies. By continuing to browse you accept their use. Further information