Loading...

addon.xml

We no longer maintain the Knowledge Base since version 4.3.x. All the latest user and developer documentation for 4.3.x and newer versions is now available at docs.cs-cart.com.

  • This article applies to CS-Cart versions:
  • 3.0.x

addon.xml v. 2.0

Below you can find a fully commented and properly marked up addon.xml file. Use it as an example for your own addon.xml files when creating add-ons.

You can find a more convenient description of all elements of the file in the Add-on Scheme section in the docs.

Download addon.xml

addon.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
<?xml version="1.0"?>
 
<!-- 
    Add-on scheme version 2.0 description
    All parameters that are not marked as optional must be defined in the scheme. 
    @edition_type - An optional attribute available for any settings-related element. It defines editions in which one or another setting is available. If left empty, the parent element value will be used. If the latter is not set, the value is considered ROOT
-->
 
<addon scheme='2.0' edition_type="ULT:ROOT,ULT:VENDOR">
    <!-- Add-on identifier. It must be equal to the catalog name in which the add-on resides -->
    <id>sample_addon_2_0</id>
 
    <!-- Add-on version -->
    <version>1.0</version> 
 
    <!-- Add-on native (default) language. An optional parameter; if not specified, the language will be recognized as English (EN)-->
    <default_language>EN</default_language> 
 
    <!-- Add-on name in the default language -->
    <name>2.0 scheme addon sample</name>
 
    <!-- Add-on description in the default language -->
    <description>This is description of addon</description>
 
    <!-- Add-on priority. The higher the priority the later the add-on is connected -->
    <priority>100</priority>
 
    <!-- Status to be set after the add-on installation (active/disabled); "disabled" by default -->
    <status>active</status>
 
    <!-- Block for the other add-ons compatibilities descriptions -->
    <compatibility>
        <!-- Dependencies. These add-ons must be installed in order to install the current one; otherwise an error message will be displayed -->
        <dependencies>discussion,form_builder</dependencies>
 
        <!-- Conflicts. These add-ons will be automatically disabled before the current add-on installation starts and the notification will be displayed-->
        <conflicts>catalog_mode,reward_points</conflicts>
    </compatibility>
 
    <!-- Translations for the non-default languages -->
    <translations> 
        <!--
            @for - points to the property for which the translation is provided. Possible values: name/description/tooltip. Optional. The default value is "name"
            @lang - the translation language code. If there is no language with the given code, the translation will not be installed
        -->
        <item for="name" lang="RU">Пример аддона версии 2.0</item>
        <item for="description" lang="RU">Описание для аддона версии 2.0</item>
    </translations>
 
    <!-- Add-on settings block. Optional.
        @layout - Defines where the settings page will be opened (popup/separate). Optional attribute; "popup" by default
    -->
    <settings layout="separate" edition_type="ULT:ROOT,ULT:VENDOR">
        <!-- List of tabs on the add-on settings page -->
        <sections>
            <!-- Tab for settings.
                @id - text identifier. This setting can be accessed later on through Registry::get('addons.[addon_id].[setting_id]')
                @edition_type - list of editions in which the tab will be available. Optional
            -->
            <section id="section1">
                <!-- Tab name in the default language -->
                <name>Generic settings</name>       
                <translations>
                    <item lang="RU" for="name">Обычные настройки</item>
                </translations>
 
                <!-- List of settings in the tab -->
                <items>
                    <!-- Add-on settings
                        @id - setting identifier.
                        @edition_type - list of editions in which the setting will be available.
                    -->
                    <item id="header">
                        <!-- Element type: 
                            input, textarea, password, checkbox, selectbox, multiple select, 
                            multiple checkboxes, countries list, states list, 
                            file, info, header, template
                        -->
                        <type>header</type>
 
                        <!-- Setting name in the default language -->
                        <name>Header</name>
 
                        <!-- Setting translations -->
                        <translations>
                            <item lang="RU" for="name">Заголовок</item>
                        </translations>
                    </item>
                    <item id="input">
                        <type>input</type>
                        <name>Input</name>
 
                        <!-- Tooltip -->
                        <tooltip>Tooltip</tooltip>
                        <translations>
                            <item lang="RU" for="name">Поле ввода</item>
                            <!-- It is possible to provide translations for tooltips too -->
                            <item lang="RU" for="tooltip">Подсказка</item>
                        </translations>
                    </item>
                    <item id="password">
                        <type>password</type>
                        <name>Password input</name>
                        <translations>
                            <item lang="RU" for="name">Поле ввода пароля</item>
                        </translations>
                    </item>
                    <item id="checkbox">
                        <type>checkbox</type>
                        <name>Checkbox</name>               
                        <translations>
                            <item lang="RU" for="name">Флажок</item>
                        </translations>
                    </item>
                    <item id="textarea">
                        <type>textarea</type>
                        <name>Textarea</name>               
 
                        <!-- Default value; must be variant id for lists (and items with variants like selectbox, multiple select etc. -->
                        <default_value>Sample textarea text</default_value>
 
                        <translations>
                            <item lang="RU" for="name">Поле ввода текста</item>
                        </translations>
                    </item>
                    <item id="radiogroup">
                        <type>radiogroup</type>
                        <name>Radio group box</name>
                        <tooltip>Tooltip</tooltip>
                        <default_value>radio_2</default_value>
 
                        <!-- Variants - for types selectbox, multiple select, 
                            multiple checkboxes, combo select -->
                        <variants>
                            <!-- @id - variant identifier -->
                            <item id="radio_1">
                                <!-- Variant name -->
                                <name>Radio button 1</name>
                                <!-- Variant translations; similar as for the add-on name, but the parameter "for" in not used -->
                                <translations>
                                    <item lang="RU">Радио кнопка 1</item>
                                </translations>
                            </item>
                            <item id="radio_2">
                                <name>Radio button 2</name>                     
                                <translations>
                                    <item lang="RU">Радио кнопка 2</item>
                                </translations>
                            </item>
                        </variants>
                        <translations>
                            <item lang="RU" for="name">Группа радиокнопок</item>
                        </translations>
                    </item>
                    <item id="file">
                        <type>file</type>
                        <name>File select</name>                
                        <translations>
                            <item lang="RU">Поле выбора файла</item>
                        </translations>
                    </item>
                </items>
            </section>
            <section id="section2">
                <name>Selects</name>
                <translations>
                    <item lang="RU">Списки</item>
                </translations>
                <items>
                    <item id="selectbox">
                        <type>selectbox</type>
                        <name>Selectbox</name>
                        <variants>
                            <item id="select_box_1">
                                <name>Select box item 1</name>
                                <translations>
                                    <item lang="RU">Элемент списка 1</item>
                                </translations>
                            </item>
                            <item id="select_box_2">
                                <name>Select box item 2</name>                      
                                <translations>
                                    <item lang="RU">Элемент списка 2</item>
                                </translations>
                            </item>
                        </variants>
                        <translations>
                            <item lang="RU">Простой список</item>
                        </translations>
                    </item>
                    <item id="countries_list">
                        <type>countries list</type>
                        <name>Countries list</name>             
                        <translations>
                            <item lang="RU">Список стран</item>
                        </translations>
                    </item>
                    <item id="states_list">
                        <type>states list</type>
                        <name>States list</name>                
                        <translations>
                            <item lang="RU">Список регионов</item>
                        </translations>
                    </item>
                    <item id="multiple_select">
                        <type>multiple select</type>
                        <name>Multiple select</name>
                        <translations>
                            <item lang="RU">Список с возможностью выбрать несколько значений</item>
                        </translations>
                        <variants>
                            <item id="select_box_1">
                                <name>Select box item 1</name>
                                <translations>
                                    <item lang="RU">Элемент списка 1</item>
                                </translations>
                            </item>
                            <item id="select_box_2">
                                <name>Select box item 2</name>                                              
                                <translations>
                                    <item lang="RU">Элемент списка 2</item>
                                </translations>
                            </item>
                            <item id="select_box_3">
                                <name>Select box item 3</name>      
                                <translations>
                                    <item lang="RU">Элемент списка 3</item>
                                </translations>             
                            </item>
                        </variants>
                    </item>
                    <item id="multiple_checkboxes">
                        <type>multiple checkboxes</type>
                        <name>Multiple select check boxes</name>
                        <translations>
                            <item lang="RU">Список флагов</item>
                        </translations>
                        <variants>
                            <item id="select_box_1">
                                <name>Select box item 1</name>
                                <translations>
                                    <item lang="RU">Элемент списка 1</item>
                                </translations>
                            </item>
                            <item id="select_box_2">
                                <name>Select box item 2</name>                                              
                                <translations>
                                    <item lang="RU">Элемент списка 2</item>
                                </translations>
                            </item>
                            <item id="select_box_3">
                                <name>Select box item 3</name>      
                                <translations>
                                    <item lang="RU">Элемент списка 3</item>
                                </translations>             
                            </item>
                        </variants>
                        <default_value>select_box_2</default_value>
                    </item>
                </items>
            </section>
            <section name="section3">
                <name>Additional settings</name>
                <translations>
                    <item lang="RU">Особые настройки</item>
                </translations>
                <items>
                    <item id="selectable_box">
                        <name>Selectable box</name>
                        <!-- The current setting options will be taken from the function fn_settings_variants_[addon_id]_[setting_id] -->
                        <type>selectable_box</type>
                        <default_value><![CDATA[#M#product_code=Y&product=Y&amount=Y&price=Y]]></default_value>
                        <translations>
                            <item lang="RU">Двухпанельный список мультивыбора</item>
                        </translations>
                    </item>
 
                    <!-- In this case the information returned by the function "handler" will be displayed -->
                    <item id="info">
                        <name>Info url</name>
                        <type>info</type>
                        <handler>fn_sample_addon_1_0_info</handler>
                        <translations>
                            <item lang="RU">Информация</item>
                        </translations>
                    </item>
                    <!-- Setting appearance; type "template". In this case a user-defined template from the folder skins/SKIN_NAME/addons/ADDON_NAME/settings/TEMPLATE_NAME is loaded.
                        The template name is stored in the "default_value" -->
                    <item id="template">
                        <type>template</type>
                        <default_value>sample.tpl</default_value>
                    </item>
 
                    <!-- A hidden setting. Exists in the database and in the Registry but is not shown to the user -->
                    <item id="hidden">
                        <type>hidden</type>
                        <default_value>Some hidden setting value</default_value>
                    </item>
                </items>
            </section>
        </sections>
    </settings>
 
    <!-- Add language variables -->
    <language_variables>
        <!-- 
            @id - language variable identifier, 
            @lang - the language it is added for -->
        <item lang="EN" id="test_xml_1.0_1">First language variable</item>
        <item lang="EN" id="test_xml_1.0_2">Second language variable</item>
 
        <item lang="RU" id="test_xml_1.0_1">Первое языковое значение</item>
        <item lang="RU" id="test_xml_1.0_2">Второе языковое значение</item>
    </language_variables>
 
    <!-- Additional database queries -->
    <queries>
        <!-- If parameter "for" equals "install" or is not set, the query is executed during the add-on installation -->
        <item for="install">
        CREATE TABLE `?:addon_test_1234567` (
            `queue_id` mediumint NOT NULL auto_increment,
            PRIMARY KEY  (`queue_id`),
        ) ENGINE=MyISAM DEFAULT CHARSET=UTF8
        </item>
        <-- If the "editions" attribute is given, the request will be executed only for the editions that are defined in it (separated with commas) -->
        <item for="install" editions="ULT,MVE">
            ALTER TABLE `?:addon_test_123456789` ADD company_id INT NOT NULL DEFAULT 0;
        </item>
        <!-- If the parameter "for" equals "uninstall", the query is executed during the add-on uninstallation -->
        <item for="uninstall">DROP TABLE IF EXISTS `?:addon_test_1234567`</item>
    </queries>
 
    <!-- User-defined functions called on certain events:
            before_install - before the add-on installation
            install - after the installation of the add-on, its templates, settings and language variables but before its activation and cache clearing
            uninstall - before uninstallation
            -->
    <functions>
        <item for="install">fn_google_export_add_features</item>
        <item for="install">fn_google_export_add_feed</item>
        <item for="uninstall">fn_google_export_remove_features</item>
        <item for="uninstall">fn_google_export_remove_feed</item>
    </functions>
</addon>

 

Deprecated Add-on Scheme

The add-on scheme above is no longer supported starting from CS-Cart 3.

Use the detailed scheme description combined with the new scheme description above to adapt old add-ons for the new version.

Download addon.xml.old

Deprecated addon.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0"?>
<addon>
    <!-- Add-on identifier. It must be equal to the catalog name in which the add-on resides -->
    <id>sample_addon_1_0</id>
 
    <!-- Add-on name in the default language -->
    <name>1.0 scheme addon sample</name> 
 
    <!-- Add-on description in the default language -->
    <description>This is description of addon</description>
 
    <!-- Add-on priority. The higher the priority the later the add-on is connected -->
    <priority>100</priority>
 
    <!-- Status to be set after the add-on installation (active/disabled); "disabled" by default -->    
    <status>active</status>
 
    <!-- Dependencies. These add-ons must be installed in order to install the current one; otherwise an error message will be displayed -->
    <dependencies>discussion,form_builder</dependencies>
 
    <!-- Translations for the non-default languages -->
    <translations>
        <!--
            @for - points to the property for which the translation is provided. Possible values: name/description/tooltip. Optional. The default value is "name"
            @lang - the translation language code. If there is no language with the given code, the translation will not be installed
        -->
        <item for="name" lang="ES">1.0 esquema de muestreo addon</item>
        <item for="description" lang="ES">Esta es la descripción del addon</item>
    </translations>
 
    <!-- Add-on settings block. Optional -->
    <opt_settings>
        <!-- Options tab. @name is tab title given as a language variable -->
        <section name="general">
            <!-- Option identifier @id is obligatory for all options that have descriptions (except for info) -->
            <item id="type">
                <!-- Setting name in the default language -->
                <name>Type</name>
 
                <!-- Element type: 
                    input, textarea, password, checkbox, selectbox, multiple select, 
                    multiple checkboxes, countries list, states list, 
                    file, info, header, template
                -->
                <type>states list</type>
 
                <!-- Default value; must be option id for lists (items with options like selectbox, multiple select etc.) -->
                <default_value>C128B</default_value>
 
                <!-- For template type options: path to template relative to the settings folder -->
                <template>opt.tpl</template>
 
                <!-- Options - for types selectbox, multiple select, 
                    multiple checkboxes, combo select -->
                <variants>
                    <!-- @id - option identifier -->
                    <item id="C128A">
                        <!-- Option name -->
                        <name>Code 128-A</name>
 
                        <!-- Option translations; similar as for the add-on name, but the parameter "for" in not used -->
                        <translations>
                            <item lang="ES">Código 128-A</item>
                        </translations>
                    </item>
                </variants>
 
                <!-- Option translations; similar as for the add-on name, but the parameter "for" in not used -->
                <translations>
                    <item lang="ES">Tipo</item>
                </translations>
            </item>
 
            <!-- This is a header. @id is obligatory, though is not used anywhere except in the description table -->
            <item id="elm_specification">
                <name>Specification</name>
                <type>header</type>
                <translations>
                    <item lang="ES">Especificación</item>
                    <item lang="FR">Spécification</item>
                </translations>
            </item>
 
            <!-- This is the info field: it displays the result returned by the function defined in @handler -->
            <item>
                <name>Info</name>
                <type>info</type>
                <handler>fn_get_barcode_specification</handler>
            </item>
 
            <!-- Array of options returned by the function defined in @custom_option_function -->
            <item>
                <custom_option_function>fn_recurring_billing_additional_settings</custom_option_function>
            </item>
        </section>
    </opt_settings>
 
    <!-- Additional database queries -->
    <opt_queries>
        <!-- If parameter for="install" or is missing, the request is executed during installation -->
        <item>ALTER TABLE ?:products ADD COLUMN test</item>
        <!-- If parameter for="uninstall", the request is executed during removal -->
        <item for="uninstall">ALTER TABLE ?:products DROP COLUMN test</item>
    </opt_queries>
 
    <!-- Add language variables -->
    <opt_language_variables>
        <!-- 
            @id - language variable identifier, 
            @lang - the language it is added for -->
        <item lang="EN" id="test123">Test</item>
    </opt_language_variables>
 
</addon>

 

<< Read previous Read next >>
Home / Docs / Appendix / addon.xml