Administration and settings
Web and e-shop - General settings
In this section, we define the statuses in which a user registration on the e-shop can be in the Registration book.

Picture: Registrations settings
Here we specify whether the recalculations are to be calculated only for registered users.

Picture: Settings of article recalculation
On the Email sending settings tab, we set the number of sending attempts and the delay between attempts if the SMTP server fails to send an e-mail from the web/e-shop. Here we can also set the validity time of the GUID for a forgotten password. The default is 30 minutes.

Picture: Email sending settings
In this section, we define the statuses in which various records can be.

Picture: Send news and special offers
The option to regenerate friendly URL addresses is offered by the general web and e-shop settings, where the displayed form contains the URL address settings option. To run it, it is necessary to check the Use clean URL field, which regenerates the existing URL addresses while their indexing in search engines remains at the current position. After the conversion, a file is displayed that filters the pages for which the URL addresses are not unique, and the administrator can set them in the given modules according to their own needs, also in other languages.
When the Clean URL with nesting option is checked, the clean URL will be displayed on the web with the structure (nesting) preserved.

Picture: URL address settings
Email templates book
The Email templates book is used to create and manage e-mail templates that are used for automatic sending of e-mails on various events (e.g. order confirmation, user registration or password reset).
The book is available in the tree menu Web e-shop / Administration and settings / Email templates.

Picture: Book - Email templates
Use of e-mail templates:
- simplifies the management of automatically sent e-mails,
- ensures uniform communication content,
- allows easy editing of texts without the need to create new templates.
In the K2 system, the user defines for which action a specific template is to be used. The linking of the template with the process itself is ensured by the system or created as part of the implementation.
The book records all created e-mail templates, which can be edited at any time according to current needs. The standard e-mail templates supplied with the K2 system can be imported in bulk using the script "ImportWysiwygEmailTemplates.pas". The script description is given in the Script catalogue, see Import of email templates.
On the Basic data tab, we must define the action on which the e-mail will be sent and the formats for the template definition. We can also set the conditions under which the template is to be used.

Picture: Email templates book - Basic data
Description of fields:
Description |
A clearer specification of what the template will be used for. |
Action |
The action for which the template will be used, e.g. registration confirmation, forgotten password, order confirmation. If we already have the action created, we select it from the list. If not, we create a new action in the Action data module using the Insert key or the New button. When creating a new action, it is necessary to define:
Picture: Action - list of existing actions
Picture: Action - new action |
Data module |
The data module from which information is loaded into the template. It is filled in automatically after the Action is entered. |
Blocked |
Option to block the template and thus prevent its use |
Filter conditions |
Using the Filter conditions button, it is possible to define under which conditions the given template is to be used. This allows:
|
Sender, Name of sender, Copy, Hidden copy |
Fields for sending. Here we can specify the name of the sender and to whom a copy or a hidden copy is to be sent. |
Subject format, Text format |
Field for specifying the format of the subject and body of the e-mail. Variants:
|
Required fields |
We use Required fields if we refer to some of the fields in K2. This area is intended to help specify the fields from the given module that are to be used in the e-mail, so that the created file is not too large. Note: used only when the K2 formatting or XSL stencil format is selected. |
Message in HTML format |
Option whether the e-mail body is in HTML |
On the Template definition tab, we create the specific content of the e-mail, which is then sent to the recipients. Here we define:
- the template for the subject,
- the template for the body.

Picture: Email templates - Template definition tab
Both templates can be defined for different language versions. Languages are switched using the button with a globe icon and the language name. By default, the default language
is set.
If we selected K2 formatting on the Basic data tab, it is possible to insert values from data fields into the template. A field reference is written in curly brackets, e.g. {ContactPersonId.Surname}. This notation fills the surname of the contact person from the corresponding record into the e-mail.
Working with WYSIWYG formatting is described in more detail in the chapter K2 formatting wysiwyg.
On the Email attachments tab, it is possible to define files that will be attached to the sent e-mail. A new attachment is created with the Insert key or the New button in the window header.

Picture: Email templates book - Email attachments - new attachment
After opening the form, it is necessary to select the Type of supplement:
- Print report - after pressing the Choose report button, a list of reports is displayed for selecting the required report.
- Email-Data - after pressing the Select Email-Data button, a dialog opens in which any file from the computer can be selected using the explorer.
On the External Documents and Documents tab, it is possible to insert files that are to be displayed in the e-mail, for example pictures or documents.
A new attachment is created with the Insert key or the New button in the window header. After opening the form, it is possible to select from documents that are already stored in the K2 system (e.g. article pictures or other attachments).
The preview of the created template is displayed with the E-mail template preview button in the ribbon. The button is available only after the template is saved.
After selecting the language and a specific record, the E-mail message form is displayed with a preview of the e-mail including the filled-in data.

Picture: E-mail template preview

Picture: Email message with the email template preview
The e-mail template preview can be:
- opened in an external e-mail client (e.g. Microsoft Outlook)
- saved to an *.eml file.
For these functions, the following buttons must be added to the ribbon of the E-mail message form:
- Open in default browser – opens the preview in the preset client or browser and saves the generated file to the user folder \K2\Mandant\Uxxxx\email_template.eml.
Note: In the web K2, the file is downloaded; in the desktop K2, it is displayed directly.
- Export to EML – saves the e-mail to an .eml file in the selected directory.
The buttons are added to the form as follows:
- We open the E-mail message window using the E-mail template preview function.
- In the ribbon, we press the right mouse button and select the Customize the ribbon for the current user option.
- In the "Choose commands from…" tree menu, we select the E-mail message. item
- From the list of commands, we select the command "Export to EML" or "Open in default browser".
- We add the selected command to the ribbon and save the changes.

Picture: Exported email template preview in Outlook
In the Email templates module, it is possible to format text using the K2 WYSIWYG editor. When creating a new template, it is enough to select the "K2 formatting WYSIWYG" option in the Text format field in the basic data and then use the editor to create the e-mail content.
The advantage of the editor is that we see the result directly while editing, including all graphic elements, without the need to export. The editor makes writing and editing templates easier, offers field search, selection of formatting and the option to change the environment language.
It supports common text operations – paragraph formatting, changing colours, indentation, numbered and bulleted lists, inserting pictures and hyperlinks. Using the editor is intuitive and can be handled by anyone who has ever worked with a text editor.
At the bottom of the editor there is a toolbar where you can change the language environment, turn the display of tags and structure on or off, switch to the structure change mode or display the HTML source code, which can be edited or copied directly.
Picture: Toolbar
When the Change structure function is on, new rows (above and below) or columns (left or right) can be inserted in the editing field using the right mouse button. After selecting the required cells, it is also possible to use the function to merge them. Thanks to these tools, the structure of the entire template can be fully modified.
Meaning of the buttons in the toolbar:
|
Back |
Used if we want to go one step back. |
|
Forward |
Used if we want to move one step forward. |
|
Arial |
Option to select the font; the Arial, Verdana, Georgia and Times New Roman styles are supported. |
|
Pen style |
Used to change the heading style. The user has several levels as well as normal text available. |
|
Font size |
Changes the font size. The user changes the size using a slider. Moving to the right enlarges the font, moving to the left reduces it. |
|
Text colour |
Changes the text colour. The user has a colour palette available from which they can select predefined colours. |
|
Remove formatting |
Removes all formats that have been set (e.g. font size or text colour). Returns the text to its original form. |
|
Bold |
The selected text is converted to bold. |
|
Italics |
The selected text is converted to italics. |
|
Underline |
The selected text is underlined. |
|
Strikethrough |
The selected text is struck through. |
|
Picture |
Allows selecting and attaching a picture. It can only be attached as a URL path to the picture. |
|
Align left |
The selected text is aligned to the left. If we click into a cell, the text in the entire cell is aligned. |
|
Align centre |
The selected text is aligned to the centre. If we click into a cell, the text in the entire cell is aligned. |
|
Align right |
The selected text is aligned to the right. If we click into a cell, the text in the entire cell is aligned. |
|
Line spacing |
Option to set the line spacing for the entire cell. |
|
Numbered list |
The selected text is converted to a numbered list. Each paragraph will be marked with a sequence number. |
|
List |
The selected text is converted to a list. Each paragraph will be marked with a predefined bullet. |
|
Link |
A link is added to the selected text via a URL address, which must be entered in the absolute Url field. Absolute URL means any web page (e.g. http://www.k2.cz or https://www.k2.cz). When creating a link, the user can also choose to create a button and select its colour. Using the plus symbol, a variable can also be inserted as the URL. |
|
Add |
Offers the option to insert a field, items or a condition. |
|
Background colour |
Changes the background colour. The user has a colour palette available from which they can select predefined colours. |
Meaning of the buttons in the toolbar in the "Change structure" mode:
|
Back |
Used if we want to go one step back. |
|
Forward |
Used if we want to move one step forward. |
|
Left border |
Adds a border on the left side of the selection. |
|
Right border |
Adds a border on the right side of the selection. |
|
Bottom border |
Adds a border on the bottom side of the selection. |
|
Top border |
Adds a border on the top side of the selection. |
|
No border |
Removes all borders. |
|
Align left |
The selected text is aligned to the left. |
|
Align centre |
The selected text is aligned to the centre. |
|
Align right |
The selected text is aligned to the right. |
|
Align top |
Allows aligning the text to the top edge. |
|
Align middle |
Allows aligning the text to the middle between the top and bottom edges. |
|
Align bottom |
Allows aligning the text to the bottom edge. |
Example No. 1 - Creating a table with sale items
In the "Order confirmation" e-mail, we want to display a table with the list of purchased articles (sale items on the sales order).
- We press the
button and select the "Insert items" option from the menu. - In the field selection, we search for "Sale Items" and insert the sale items into the template with the Select button.
- We switch to the Change structure mode.
- In the "Inserted items" cell, we press the right mouse button and select the Insert cell right/left. option. In this way, we create as many cells as the number of table columns we need.
- Then, by right-clicking any "Inserted items" cell, we select the Insert row above. option. This creates the table header.
- We turn off the Change structure mode and write the column names in the table header.
- Using the
button, we insert data fields (e.g. ArticleId.Abbr, EshopArticleNameCalc, QuantityUMCalc) into the corresponding cells (columns) of the Sale Items.
Example No. 2 - Adding a condition to a field
In the "Order confirmation" e-mail, we want the article name to be displayed in black if it is a classic article card and in blue if it is an article of the Set type.
If we want to display a field in different colours under different conditions, we must enter the data field as many times as there are display variants and set a condition for each field specifying when it is to be displayed in the e-mail.
- In the Sale Items cell in the Name column, we insert the ArticleId.Abbr field twice.
- We leave one field black and change the colour of the other to blue.
- We select the first (black) field, press the button
and select the "Insert condition", option from the menu, where we fill in the condition parameters. Then we select the second (blue) field, again press the button
, select the "Insert condition" option from the menu and define the condition for the Set article type:

Picture: Condition definition - type NOT EQUAL to Set (black field)

Picture: Condition definition - type EQUAL to Set (blue field)
The created table with the defined conditions looks as follows:

Picture: E-mail template definition - Order confirmation

Picture: E-mail - Order receipt confirmation
Overview of tables, reports, scripts and other functions
Tables in K2
- ESBANNER - Banners book
- ESBASKET - shopping basket
- ESBASKETITEM - shopping basket items
- ESCALCSTATSGOODS - calculated article statistics. The table is calculated using the statistics recalculation - the Recalculate goods statistics option.
- ESCATEGORYALLGOODS - articles in the tree structure (including the e-shop). The table is calculated using the statistics recalculation - the Recalculate the assigning of articles to shop option.
- ESCATEGORYGOODS - content of all categories (article or group)
- ESCATEGORYINFO - Category book
- ESDELIVERY - Deliveries for e-shop book
- ESDELIVERYBRANCHES - branches for the collection method
- ESDELIVERYPAYMENTS - combinations of payments and collection methods for e-shops
- ESFAVORITE - Favourites book
- ESGOODS - view of articles for e-shops
- ESGOODSPRICE - article prices. The table is calculated using the statistics recalculation - the Update article prices option.
- ESGOODSSHOPVALUE - flags of news, tips, etc. in individual online stores. The table is calculated using the statistics recalculation - the Recalculate the assigning of articles to shop option.
- ESGOODSTEXT - language texts for articles. The table is calculated using the statistics recalculation - the Update language texts of articles option.
- ESORDER - orders from the online store (contains the order XML)
- ESPAYMENT - Payments for e-shop book
- ESREGISTRATION - Registration book
- ESEARCHWORD - searched words for articles
- ESSHOP - Online stores book
- ESSTATISTIC - calculated article statistics. The types 2000000343 (Article detail), 2000000344 (text page), 2000000345 (category), 2000000346 (banner loading) and 2000000348 (banner click) are used with the ID of the specific element.
- ESSTOCKTEXT - Alternative texts of stock level book
- ESSTOCKTEXTITEM - items of the Alternative texts of stock level book
- ESTEXTPAGE - Text pages book
- ESWATCHDOG - Watchdog book
Reports
- E-mail message (EshopEmail.AM) - a "preview" of the sales order in the form of an Order.
Scripts
- Export XML feed for comparators (EshopXMLFeedExport.PAS) - allows exporting article prices for Zboží.cz, Heureka and Google merchants. The result of the export is three XML files, each created separately for the given comparator. The script goes through the articles published for the e-shop, exports their prices and at the same time assigns them to the category with the same products. It is also possible to export article parameters or article availability for the main warehouse and for the branch warehouses for the Heureka.cz server.
- Adding pictures to articles (NewEshop_AddPicture.PAS) - allows importing pictures for a specific article, assigns them to the specified categories and sets the required size. The difference from the older version of the script is that this script does not cut the pictures. Another difference is that the same picture is not attached to each article separately; instead, one attached picture is created, which is then attached to further articles. Therefore, the picture will be placed in the K2 folder only once, with the number of the first article.
- Import of web/e-shop categories (EshopCategoryImport.PAS) - allows importing categories into the selected web/e-shop from the specified tree stored in the general interface (used e.g. for FastCentrik).
- Export of text pages (K2ETextPageExp.PAS) - allows exporting the marked texts in the selected languages (according to the parameter) to an XML file, including their "order" in the specific pages of the Web and e-shop settings.
- Import of text pages (K2ETextPageImp.PAS) - allows importing an XML file with texts into the selected e-shop specified by the parameter. It can also insert a link to the newly created pages into the Settings of the given e-shop according to their "order" in the original web/e-shop.
- Update of the web, e-shop cache (EshopCron.PAS) - allows regenerating the cache. It is used for the task scheduler, where it is set to run at a 5-minute interval. The cache validity is 4:30 min. Therefore, it makes no sense to run the script more often.
- Import Heureka.cz categories (EshopHeurekaCatImport.PAS) - imports the list of Heureka categories from a file that the user downloads from the Heureka.cz server. See the script catalogue.
- Import of Zboží.cz categories (EshopZboziCatImport.pas)- The script allows importing into K2 the code list of categories provided by the Zboží.cz server. Their use is similar if we want to use the services of this server. The categories are then filled in on individual Article cards on the Eshop tab - Info for price search engines. See the script catalogue.
- Import of Google Merchant Center categories (EshopMerchantCenterCatImport.pas) - the script allows importing into K2 the code list of categories provided by the Google Merchant Center server. Their use is suitable if we want to use the services of this server. See the script catalogue.
- Reset of contact person password (CPResetPassword.PAS) - generates a new password or complete login data for the given contact person or the marked contact person records. It can send an e-mail with the new data to these persons.
- Attaching a contact person to a Customer (CPCusAttach.pas) - A script that, when run on a contact person not attached to a partner, searches the addresses on the 3rd page and tries to find the customer in K2 according to the Comp. Reg. No. stated there. If it does not exist, it uses ARES to pre-fill a new record in the Suppl./Cust. book and offers it to the user for saving.
- Getting a link to a file (LinkUrlPreview.pas) - A script for displaying a preview of the full URL of a link to a file from the 9th page (links tab). The script is added to F9 or the toolbar above each module where the function is needed, and a single parameter RootURL is set for it, e.g. <shop address>/Pictures/, which specifies the root URL address of the file storage. The script then displays previews of the full URL address of the current record in the Links on the 9th page.
- Deletion of unattached pictures and links (UnusedPictures.pas) - A script for deleting unattached pictures from links (Links) that remained as files and, conversely, invalid links to pictures.
- Bulk upload of article pictures to the 9th page (Eshop_ImportPictures.PAS) - the script tries to find, by the article abbreviation or name, a file with the corresponding name in the given directory (specified by the parameter) (a matching beginning of the file name is enough). It moves the attached files to the Attached subdirectory.
- Attaching a document to an article (Eshop_AddDocument.PAS) - The script is intended for attaching a document to an article card. The document is attached to the External Documents and Documents page on the Links tab. The file must be physically stored with the e-shop, so that only the links are copied to the article cards.
- Deletion of article parameters on the Article parameters page (RemoveUnusedParameters.PAS) - The script is used to delete parameters outside the classification on the Article parameters page.
- Import of categories (with the option to add articles) from Excel - (ImportCategory.pas) - the script allows importing categories from Excel into the selected web/e-shop. Using a parameter, it is also possible to import articles from Excel.
- Unpaid advance notification (UnpaidAdvanceNotification.PAS) - The script filters all unpaid advances from the e-shop. If the Number of days of delay is filled in, the e-mail is sent automatically via the task scheduler. If the number of days is not filled in, the e-mail is sent only once and an activity is created. If a responsible person is filled in the parameters, they always receive the e-mail with the due date notification.
- Initialization of web modules (Eshop_InitWebModules.PAS) - The script is intended for an easy transition between the older and the new version of the e-shop. After it is run, the data are converted from the older responsive e-shop to the new version of the template e-shop.
- Filling in the name for the e-shop (EshopFillEsName.PAS) - The script fills in the article name from the basic product data on the E-shop tab. The script can only be run on the container of articles.
- Setting the New flag (Eshop_SetNews.PAS) - The script sets the New flag on the E-shop tab for newly added articles (the parameters can be used to set how long an article is considered new).
- Export of web texts (Eshop_WebText_Export.PAS) - The script is intended only for the new (template) version of the e-shop. It allows exporting web texts including translations to an XML file.
- Import of web texts (Eshop_WebText_Import.PAS) - The script is intended only for the new (template) version of the e-shop. It allows importing web texts including translations from an XML file.
- Reply to question from the e-shop (ES_ReportFromEshop.PAS) - The script is intended for easily replying to questions received from the web/e-shop.
K2 functions
- E-shop - Recalculation of article statistics - allows calculating auxiliary tables for the e-shop. These are tables that, for practical (and performance) reasons, are not connected to the e-shop directly, such as articles, prices, articles in categories, etc. This recalculation is usually run as a scheduled action (due to the large volume of processed data). The Recalculate the assigning of articles to shop option calculates the EsCategoryAllGoods and EsGoodsShopValue tables, especially after a change of relevant data by a script, a change of the Do not display flag on a Category or a change of the Hide on e-shop flag, because e.g. a manually inserted category or a change of other flags on the Article card is reflected in the tables immediately. The Recalculate goods statistics option calculates the EsCalcStatsGoods table. The Update language texts of articles option calculates the EsGoodsText table and the Update article prices option calculates the EsGoodsPrice table. The other tables are updated immediately.
- Shift+F3 in the Article book allows recalculating a specific Article card or marked Article records.
Note: For security reasons, it is not possible to run recalculations concurrently or together with the Shift+F3 function. K2 monitors this concurrency. If a similar action is run by a special script, it is necessary to first verify whether the action is possible - the function HoldShopRecalc(var AUser: String; ACheckOnly: Boolean = False): Boolean exists on TD_Zbo, TD_esCategoryInfo and TD_esShop. It is also possible to prohibit running recalculations by a script with this function; after the action is performed, the recalculations must be enabled again with the UnHoldShopRecalc function.
Note: Running of recalculations is recorded through error logs of type 19.
- Configure picture link storage - sets the path for storing links from the External Documents and Documents tab - the Links tab, as well as access to the FTP storage.
- Orders from the e-shop - displays a preview of the XML file created after the order is submitted.
- Export and import of the initial e-shop data
- Shift + F5 in the Webs and e-shops book on the selected record (e-shop) allows exporting a file with all the initial data of the given e-shop, i.e. Text pages, Web menu, Blogs, History, timeline, Career, job offers, etc. (All code lists that are stored in the K2 tree under the Web and e-shop -> Other modules module.)
- Shift + F6 in the Webs and e-shops book on the selected record (e-shop) allows importing the file with data exported above into the current e-shop.
- Ctrl + F11 is a function that greatly simplifies the translation of individual fields into foreign languages. After it is run, the user sees a form containing all translatable fields in the given book or code list. For more information, see Fields translations.
User rights for web and e-shop
In the User roles - User rights - Rights module, it is possible to set user rights for the Web and e-shop module.

Picture: Rights definition for Web and e-shop

