Extension configuration file
Most of initial and default settings can be provided in configuration file. This files will be process on extension installation and configuration reset steps. Bellow is the description of all items that are available in configuration file
<?xml version="1.0"?> <extension> <id>discount</id> <version>0.1.0</version> <cartversions> <item>1.0</item> </cartversions> <phpmodules> <item>curl</item> </phpmodules> <layout></layout> <priority>10</priority> <type>template</type> <category>template</category> <dependencies> <item prior_version="0.9" version="1.0">slideshow</item> <item prior_version="0.9" version="1.0">product_slider</item> <item required="true" prior_version="0.9" version="1.0">default_cod</item> </dependencies> <settings> <item id="discount_status"> <type>selectbox</type> <default_value>0</default_value> <variants> <item>0</item> <item>1</item> </variants> </item> <item id="discount_percent"> <type>input</type> <default_value>10</default_value> </item> <item id="discount_message"> <type>input</type> <default_value>We are pleased to annouce september discounts</default_value> </item> <item id="discount_product_message"> <type>input</type> <default_value>Old price: %s, You save: %s</default_value> </item> </settings> <additional_settings><![CDATA[setting/setting&active=store]]></additional_settings> <note>true</note> <preview> <item>preview.jpg</item> <item>preview1.jpg</item> <item>preview2.jpg</item> </preview> <help_link><![CDATA[http://google.com]]></help_link> <install> <sql>install.sql</sql> <trigger>install.php</trigger> </install> <uninstall> <sql>uninstall.sql</sql> <trigger>uninstall.php</trigger> </uninstall> </extension>
More details about each extension config item
<id>discount</id> - extension unique named identifier ( should be unique among all other extensions )
<version>0.1.0</version> - current extension version
<cartversions>
<item>1.0</item>
</cartversions> - supported cart versions by the extension
<dependencies>...</dependencies> - if given extension depends on other extension(s) be installed, this item can be used. See examples:
Optional extension dependency. original extension can work without dependant extension installed. ( use only 0.9 - 1.0 versions of extension )
<dependencies> <item prior_version="0.9" version="1.0">slideshow</item> </dependencies>
Required extension. Current extension can not work without dependant extension installed.
<dependencies> <item required="true" prior_version="0.9" version="1.0">default_cod</item> - extension. </dependencies> <phpmodules> <item>gd</item> </phpmodules> - Given extension depends on following php modules
<priority>10</priority> - Extension priority. This will set when current extension needs to be included and ran compare to other extensions installed.
Higher number will make extension with higher priority.
<type>template</type> - extension type. can be 'extensions', 'payment', 'shipping', 'template'. New types might be added in the future.
<category>template</category> - extension category. This mostly used for grouping extensions and not used in AbanteCart itself.
<settings>.. </settings> - contains extension settings
See allowed settings types below.
<settings> <item id="discount_status"> <type>selectbox</type> <default_value>0</default_value> <variants> <item>0</item> <item>1</item> </variants> </item> <item id="discount_percent"> <type>input</type> <default_value>10</default_value> </item> </settings>
Starting from version 1.1.5 global settings have been implemented. Now common settings such as status, sort_order etc. are not required to be included.
If common settings are still included in given extension configuration file, they will override global settings.
If global setting is not needed, it can be disabled with adding <disabled>true</disabled>
<item id="payment_minimum_total"> <disabled>true</disabled> </item>
Global settings are located in core/extension/ directory and attached to top or bottom of the settings page.
Global settings available for any extension (default section) and for extension type as well, such as shipping and payment.
<additional_settings>...</additional_settings> - you can add link to additional extension settings. It could be controller inside extension or any existing admin controller. By default button title will be ‘Additional Settings’. If you want to change it - you should add language definition with key = ‘text_additional_settings’ to your language file - it will define button title
<additional_settings><![CDATA[setting/setting&active=store]]></additional_settings>
<note>true</note> - define if extensions have notes or not. notes defined in language file with key = ‘<extension_name>_note’. note will be shown on extension edit page. This note can help with additional information to users how to manage extension or extra steps to set up extension.
<preview>...</preview> - extension preview images. stored in [extension_id]/image/ folder
<preview> <item>preview.jpg</item> <item>preview1.jpg</item> <item>preview2.jpg</item> </preview>
<help_link><![CDATA[http://www.google.com]]></help_link> - define help page link. if not empty - you will have help button on extension edit page. This can be external link.
<install> <sql>install.sql</sql> - sql queries run on install <trigger>install.php</trigger> - php code run on install </install> <uninstall> <sql>uninstall.sql</sql> - sql queries run on uninstall <trigger>uninstall.php</trigger> - php code run on uninstall </uninstall>