Index: in-commerce/admin_templates/site_domains/site_domain_edit.tpl
===================================================================
--- in-commerce/admin_templates/site_domains/site_domain_edit.tpl	(revision 0)
+++ in-commerce/admin_templates/site_domains/site_domain_edit.tpl	(revision 0)
@@ -0,0 +1,73 @@
+<inp2:adm_SetPopupSize width="750" height="560"/>
+
+<inp2:m_include t="incs/header"/>
+<inp2:m_RenderElement name="combined_header" section="in-portal:site_domains"  prefix="site-domain" title_preset="site_domain_edit_in_commerce" tab_preset="Default"/>
+
+<!-- ToolBar -->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+	<tr>
+  	<td>
+  		<script type="text/javascript">
+				a_toolbar = new ToolBar();
+				a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+							submit_event('site-domain', '<inp2:site-domain_SaveEvent/>');
+						}
+					) );
+				a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+							cancel_edit('site-domain', 'OnCancelEdit','<inp2:site-domain_SaveEvent/>','<inp2:m_Phrase label="la_FormCancelConfirmation" escape="1"/>');
+						}
+				 ) );
+
+			 a_toolbar.AddButton( new ToolBarButton('reset_edit', '<inp2:m_phrase label="la_ToolTip_Reset" escape="1"/>', function() {
+						reset_form('site-domain', 'OnReset', '<inp2:m_Phrase label="la_FormResetConfirmation" escape="1"/>');
+					}
+			 	) );
+
+				a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+				a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+							go_to_id('site-domain', '<inp2:site-domain_PrevId/>');
+						}
+				 ) );
+				a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+							go_to_id('site-domain', '<inp2:site-domain_NextId/>');
+						}
+				 ) );
+
+				a_toolbar.Render();
+
+				<inp2:m_if check="site-domain_IsSingle">
+					a_toolbar.HideButton('prev');
+					a_toolbar.HideButton('next');
+					a_toolbar.HideButton('sep1');
+				<inp2:m_else/>
+					<inp2:m_if check="site-domain_IsLast">
+						a_toolbar.DisableButton('next');
+					</inp2:m_if>
+					<inp2:m_if check="site-domain_IsFirst">
+						a_toolbar.DisableButton('prev');
+					</inp2:m_if>
+				</inp2:m_if>
+			</script>
+		</td>
+	</tr>
+</tbody>
+</table>
+
+<inp2:site-domain_SaveWarning name="grid_save_warning"/>
+<inp2:site-domain_ErrorWarning name="form_error_warning"/>
+
+<div id="scroll_container">
+	<table class="edit-form">
+		<inp2:m_RenderElement name="inp_edit_options" prefix="site-domain" field="BillingCountry" title="la_fld_BillingCountry" has_empty="1"/>
+		<inp2:m_RenderElement name="inp_edit_options" prefix="site-domain" field="ShippingCountry" title="la_fld_ShippingCountry" has_empty="1"/>
+		<inp2:m_RenderElement name="inp_edit_options" prefix="site-domain" field="PrimaryCurrencyId" title="la_fld_Currency" has_empty="1"/>
+		<inp2:m_RenderElement name="inp_edit_picker" prefix="site-domain" field="Currencies" title="la_fld_Currencies" optprefix="curr" option_key_field="CurrencyId" option_value_field="Translation"/>
+		<inp2:m_RenderElement name="inp_edit_options" prefix="site-domain" field="PrimaryPaymentTypeId" title="la_fld_PaymentType" has_empty="1"/>
+		<inp2:m_RenderElement name="inp_edit_picker" prefix="site-domain" field="PaymentTypes" title="la_fld_PaymentTypes" optprefix="pt" option_key_field="PaymentTypeId" option_value_field="Name"/>
+		<inp2:m_RenderElement name="inp_edit_filler"/>
+	</table>
+</div>
+
+<inp2:m_include t="incs/footer"/>
Index: in-commerce/install/english.lang
===================================================================
--- in-commerce/install/english.lang	(revision 13400)
+++ in-commerce/install/english.lang	(working copy)
@@ -90,6 +90,7 @@
 			<PHRASE Label="la_col_Amount" Module="In-Commerce" Type="1">QW1vdW50</PHRASE>
 			<PHRASE Label="la_col_Availability" Module="In-Commerce" Type="1">QXZhaWwu</PHRASE>
 			<PHRASE Label="la_col_BaseFee" Module="In-Commerce" Type="1">QmFzZSBGZWU=</PHRASE>
+			<PHRASE Label="la_col_BillingCountry" Module="In-Commerce" Type="1">QmlsbGluZyBDb3VudHJ5</PHRASE>
 			<PHRASE Label="la_col_BuiltIn" Module="In-Commerce" Type="1">QnVpbHQtSW4=</PHRASE>
 			<PHRASE Label="la_col_CODallowed" Module="In-Commerce" Type="1">Q09EIEFsbG93ZWQ=</PHRASE>
 			<PHRASE Label="la_col_Code" Module="In-Commerce" Type="1">Q29kZQ==</PHRASE>
@@ -103,6 +104,7 @@
 			<PHRASE Label="la_col_CouponCode" Module="In-Commerce" Type="1">Q291cG9uIENvZGU=</PHRASE>
 			<PHRASE Label="la_col_CouponItemType" Module="In-Commerce" Type="1">Q291cG9uIEl0ZW0gVHlwZQ==</PHRASE>
 			<PHRASE Label="la_col_CreditCardNumber" Module="In-Commerce" Type="1">Q3JlZGl0IENhcmQgTnVtYmVy</PHRASE>
+			<PHRASE Label="la_col_Currency" Module="In-Commerce" Type="1">Q3VycmVuY3k=</PHRASE>
 			<PHRASE Label="la_col_CurrencyName" Module="In-Commerce" Type="1">TmFtZQ==</PHRASE>
 			<PHRASE Label="la_col_CurrencySymbol" Module="In-Commerce" Type="1">U3ltYm9s</PHRASE>
 			<PHRASE Label="la_col_CurrencySymbolPosition" Module="In-Commerce" Type="1">U3ltYm9sIFBvc2l0aW9u</PHRASE>
@@ -180,6 +182,7 @@
 			<PHRASE Label="la_col_ReturnedOn" Module="In-Commerce" Type="1">UmV0LiBEYXRl</PHRASE>
 			<PHRASE Label="la_col_ReturnType" Module="In-Commerce" Type="1">UmV0LiBUeXBl</PHRASE>
 			<PHRASE Label="la_col_Shipping" Module="In-Commerce" Type="1">U2hpcHBpbmc=</PHRASE>
+			<PHRASE Label="la_col_ShippingCountry" Module="In-Commerce" Type="1">U2hpcHBpbmcgQ291bnRyeQ==</PHRASE>
 			<PHRASE Label="la_col_ShippingFromLocation" Module="In-Commerce" Type="1">RnJvbSBMb2NhdGlvbg==</PHRASE>
 			<PHRASE Label="la_col_ShippingName" Module="In-Commerce" Type="1">TmFtZQ==</PHRASE>
 			<PHRASE Label="la_col_ShippingQuoteEngineName" Module="In-Commerce" Type="1">TmFtZQ==</PHRASE>
@@ -311,6 +314,8 @@
 			<PHRASE Label="la_fld_CostType" Module="In-Commerce" Type="1">Q29zdCBUeXBl</PHRASE>
 			<PHRASE Label="la_fld_CouponCode" Module="In-Commerce" Type="1">Q291cG9uIENvZGU=</PHRASE>
 			<PHRASE Label="la_fld_CreditCardNumber" Module="In-Commerce" Type="1">Q3JlZGl0IENhcmQgTnVtYmVy</PHRASE>
+			<PHRASE Label="la_fld_Currencies" Module="In-Commerce" Type="1">Q3VycmVuY2llcw==</PHRASE>
+			<PHRASE Label="la_fld_Currency" Module="In-Commerce" Type="1">Q3VycmVuY3k=</PHRASE>
 			<PHRASE Label="la_fld_CurrencyName" Module="In-Commerce" Type="1">TmFtZQ==</PHRASE>
 			<PHRASE Label="la_fld_CurrencySymbol" Module="In-Commerce" Type="1">U3ltYm9s</PHRASE>
 			<PHRASE Label="la_fld_CurrencySymbolPosition" Module="In-Commerce" Type="1">U3ltYm9sIFBvc2l0aW9u</PHRASE>
@@ -381,6 +386,7 @@
 			<PHRASE Label="la_fld_PaymentType" Module="In-Commerce" Type="1">UGF5bWVudCBUeXBl</PHRASE>
 			<PHRASE Label="la_fld_PaymentTypeCurrencies" Module="In-Commerce" Type="1">QXZhaWxhYmxlIEN1cnJlbmNpZXM=</PHRASE>
 			<PHRASE Label="la_fld_PaymentTypeId" Module="In-Commerce" Type="1">UGF5bWVudCBUeXBlIElk</PHRASE>
+			<PHRASE Label="la_fld_PaymentTypes" Module="In-Commerce" Type="1">UGF5bWVudCBUeXBlcw==</PHRASE>
 			<PHRASE Label="la_fld_PercentSurcharge" Module="In-Commerce" Type="1">UGVyY2VudCBTdXJjaGFyZ2U=</PHRASE>
 			<PHRASE Label="la_fld_Period" Module="In-Commerce" Type="1">UGVyaW9k</PHRASE>
 			<PHRASE Label="la_fld_PlacedOrdersEdit" Module="In-Commerce" Type="1">QWxsb3cgUGxhY2VkIE9yZGVycyBFZGl0aW5n</PHRASE>
Index: in-commerce/install/install_schema.sql
===================================================================
--- in-commerce/install/install_schema.sql	(revision 13400)
+++ in-commerce/install/install_schema.sql	(working copy)
@@ -711,4 +711,18 @@
   ResourceId int(10) unsigned NOT NULL default '0',
   KEY ResourceId (ResourceId),
   PRIMARY KEY  (CustomDataId)
-);
\ No newline at end of file
+);
+
+ALTER TABLE SiteDomains
+	ADD COLUMN BillingCountry varchar(3) NOT NULL DEFAULT '',
+	ADD COLUMN ShippingCountry varchar(3) NOT NULL DEFAULT '',
+	ADD COLUMN PrimaryCurrencyId int(11) NOT NULL DEFAULT '0',
+	ADD COLUMN Currencies varchar(255) NOT NULL DEFAULT '',
+	ADD COLUMN PrimaryPaymentTypeId int(11) NOT NULL DEFAULT '0',
+	ADD COLUMN PaymentTypes varchar(255) NOT NULL DEFAULT '',
+	ADD INDEX (BillingCountry),
+	ADD INDEX (ShippingCountry),
+	ADD INDEX (PrimaryCurrencyId),
+	ADD INDEX (Currencies),
+	ADD INDEX (PrimaryPaymentTypeId),
+	ADD INDEX (PaymentTypes);
\ No newline at end of file
Index: in-commerce/install/upgrades.sql
===================================================================
--- in-commerce/install/upgrades.sql	(revision 13465)
+++ in-commerce/install/upgrades.sql	(working copy)
@@ -126,4 +126,18 @@
 
 UPDATE ConfigurationValues
 SET ValueList = '0=lu_none||<SQL+>SELECT l%3$s_Name AS OptionName, CountryStateId AS OptionValue FROM <PREFIX>CountryStates WHERE Type = 1 ORDER BY OptionName</SQL>'
-WHERE ValueList = '0=lu_none||<SQL>SELECT DestName AS OptionName, DestAbbr AS OptionValue FROM <PREFIX>StdDestinations WHERE DestParentId IS NULL Order BY OptionName</SQL>';
\ No newline at end of file
+WHERE ValueList = '0=lu_none||<SQL>SELECT DestName AS OptionName, DestAbbr AS OptionValue FROM <PREFIX>StdDestinations WHERE DestParentId IS NULL Order BY OptionName</SQL>';
+
+ALTER TABLE SiteDomains
+	ADD COLUMN BillingCountry varchar(3) NOT NULL DEFAULT '',
+	ADD COLUMN ShippingCountry varchar(3) NOT NULL DEFAULT '',
+	ADD COLUMN PrimaryCurrencyId int(11) NOT NULL DEFAULT '0',
+	ADD COLUMN Currencies varchar(255) NOT NULL DEFAULT '',
+	ADD COLUMN PrimaryPaymentTypeId int(11) NOT NULL DEFAULT '0',
+	ADD COLUMN PaymentTypes varchar(255) NOT NULL DEFAULT '',
+	ADD INDEX (BillingCountry),
+	ADD INDEX (ShippingCountry),
+	ADD INDEX (PrimaryCurrencyId),
+	ADD INDEX (Currencies),
+	ADD INDEX (PrimaryPaymentTypeId),
+	ADD INDEX (PaymentTypes);
\ No newline at end of file
Index: in-commerce/units/addresses/addresses_event_handler.php
===================================================================
--- in-commerce/units/addresses/addresses_event_handler.php	(revision 13465)
+++ in-commerce/units/addresses/addresses_event_handler.php	(working copy)
@@ -318,4 +318,21 @@
 				return ;
 			}
 		}
+
+		/**
+		 * Sets default country for new addresses to Latvia
+		 *
+		 * @param kEvent $event
+		 */
+		function OnAfterConfigRead(&$event)
+		{
+			parent::OnAfterConfigRead($event);
+
+			$site_helper =& $this->Application->recallObject('SiteHelper');
+			/* @var $site_helper SiteHelper */
+
+			$fields = $this->Application->getUnitOption($event->Prefix, 'Fields');
+			$fields['Country']['default'] = $site_helper->getDefaultCountry('Shipping');
+			$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
+		}
 	}
\ No newline at end of file
Index: in-commerce/units/currencies/currencies_event_handler.php
===================================================================
--- in-commerce/units/currencies/currencies_event_handler.php	(revision 13400)
+++ in-commerce/units/currencies/currencies_event_handler.php	(working copy)
@@ -95,6 +95,23 @@
 		if (!$this->Application->isAdminUser) {
 			$object->addFilter('status_filter', $object->TableName.'.Status = 1');
 		}
+
+		// site domain currency picker
+		if ($event->Special == 'selected' || $event->Special == 'available') {
+			$edit_picker_helper =& $this->Application->recallObject('EditPickerHelper');
+			/* @var $edit_picker_helper EditPickerHelper */
+
+			$edit_picker_helper->applyFilter($event, 'Currencies');
+			$object->addFilter('status_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+		}
+
+		// apply domain-based currency filtering
+		$currencies = $this->Application->siteDomainField('Currencies');
+
+		if (strlen($currencies)) {
+			$currencies = explode('|', substr($currencies, 1, -1));
+			$object->addFilter('domain_filter', '%1$s.CurrencyId IN (' . implode(',', $currencies) . ')');
+		}
 	}
 
 	/**
@@ -208,7 +225,17 @@
 
 	function OnChangeCurrency(&$event)
 	{
-		$this->Application->StoreVar('curr_iso', $this->Application->GetVar('curr_iso'));
+		$currency_iso = $this->Application->GetVar('curr_iso');
+		$available_currencies = $this->Application->siteDomainField('Currencies');
+
+		if ($available_currencies) {
+			if (strpos($available_currencies, '|' . $currency_iso . '|') === false) {
+				// currency isn't allowed in site domain
+				return ;
+			}
+		}
+
+		$this->Application->StoreVar('curr_iso', $currency_iso);
 	}
 
 	/**
Index: in-commerce/units/orders/orders_event_handler.php
===================================================================
--- in-commerce/units/orders/orders_event_handler.php	(revision 13465)
+++ in-commerce/units/orders/orders_event_handler.php	(working copy)
@@ -538,17 +538,16 @@
 	function OnProceedToBilling(&$event)
 	{
 		$items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) );
-		if($items_info)
-		{
-			list($id,$field_values) = each($items_info);
+		if ($items_info) {
+			list($id, $field_values) = each($items_info);
 
 			$object =& $event->getObject();
 			$payment_type_id = $object->GetDBField('PaymentType');
-			if(!$payment_type_id)
-			{
-				$default_type = $this->Conn->GetOne('SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes WHERE IsPrimary = 1');
-				if($default_type)
-				{
+
+			if (!$payment_type_id) {
+				$default_type = $this->_getDefaultPaymentType();
+
+				if ($default_type) {
 					$field_values['PaymentType'] = $default_type;
 					$items_info[$id] = $field_values;
 					$this->Application->SetVar( $event->getPrefixSpecial(true), $items_info );
@@ -1115,7 +1114,8 @@
 		}
 
 		// get payment type
-		$default_type = $this->Conn->GetOne('SELECT PaymentTypeId FROM '.TABLE_PREFIX.'PaymentTypes WHERE IsPrimary = 1');
+		$default_type = $this->_getDefaultPaymentType();
+
 		if ($default_type) {
 			$object->SetDBField('PaymentType', $default_type);
 		}
@@ -1133,6 +1133,25 @@
 		return 0;
 	}
 
+	/**
+	 * Returns default payment type for order
+	 *
+	 * @return int
+	 */
+	function _getDefaultPaymentType()
+	{
+		$default_type = $this->Application->siteDomainField('PrimaryPaymentTypeId');
+
+		if (!$default_type) {
+			$sql = 'SELECT PaymentTypeId
+					FROM ' . TABLE_PREFIX . 'PaymentTypes
+					WHERE IsPrimary = 1';
+			$default_type = $this->Conn->GetOne($sql);
+		}
+
+		return $default_type;
+	}
+
 	function StoreContinueShoppingLink()
 	{
 		$this->Application->StoreVar('continue_shopping', 'external:'.PROTOCOL.SERVER_NAME.$this->Application->RecallVar('last_url'));
@@ -1975,6 +1994,21 @@
 		$object =& $event->getObject();
 		/* @var $object OrdersItem */
 
+		$old_payment_type = $object->GetOriginalField('PaymentType');
+		$new_payment_type = $object->GetDBField('PaymentType');
+
+		if ($new_payment_type != $old_payment_type) {
+			// payment type changed -> check that it's allowed
+			$available_payment_types = $this->Application->siteDomainField('PaymentTypes');
+
+			if ($available_payment_types) {
+				if (strpos($available_payment_types, '|' . $new_payment_type . '|') === false) {
+					// payment type isn't allowed in site domain
+					$object->SetDBField('PaymentType', $old_payment_type);
+				}
+			}
+		}
+
 		$cs_helper =& $this->Application->recallObject('CountryStatesHelper');
 		/* @var $cs_helper kCountryStatesHelper */
 
@@ -3824,15 +3858,34 @@
 		$fields['Number']['format'] = str_replace('%06d', '%0'.$order_number.'d', $fields['Number']['format']);
 		$fields['SubNumber']['format'] = str_replace('%03d', '%0'.$order_sub_number.'d', $fields['SubNumber']['format']);
 
+		$site_helper =& $this->Application->recallObject('SiteHelper');
+		/* @var $site_helper SiteHelper */
+
+		$fields['BillingCountry']['default'] = $site_helper->getDefaultCountry('Billing');
+		$fields['ShippingCountry']['default'] = $site_helper->getDefaultCountry('Shipping');
+
 		if (!$this->Application->isAdminUser) {
 			$user_groups = explode(',', $this->Application->RecallVar('UserGroups'));
 			$default_group = $this->Application->ConfigValue('User_LoggedInGroup');
 			if (!in_array($default_group, $user_groups)){
 				$user_groups[]=$default_group;
 			}
-			$fields['PaymentType']['options_sql'] .= ' AND ';
-			$fields['PaymentType']['options_sql'] .= ' (PortalGroups LIKE "%%,'.implode(',%%" OR PortalGroups LIKE "%%,', $user_groups).',%%")';
 
+			$sql = $fields['PaymentType']['options_sql'];
+
+			// limit payment types by domain
+			$payment_types = $this->Application->siteDomainField('PaymentTypes');
+
+			if (strlen($payment_types)) {
+				$payment_types = explode('|', substr($payment_types, 1, -1));
+				$sql .= ' AND PaymentTypeId IN (' . implode(',', $payment_types) . ')';
+			}
+
+			// limit payment types by user group
+			$sql .= ' AND (PortalGroups LIKE "%%,'.implode(',%%" OR PortalGroups LIKE "%%,', $user_groups).',%%")';
+
+			$fields['PaymentType']['options_sql'] = $sql;
+
 		}
 
 		$this->Application->setUnitOption($event->Prefix, 'Fields', $fields);
Index: in-commerce/units/payment_type/payment_type_event_handler.php
===================================================================
--- in-commerce/units/payment_type/payment_type_event_handler.php	(revision 13400)
+++ in-commerce/units/payment_type/payment_type_event_handler.php	(working copy)
@@ -218,4 +218,38 @@
 		return parent::getPassedID($event);
 	}
 
+	/**
+	 * Apply system filter to themes list
+	 *
+	 * @param kEvent $event
+	 */
+	function SetCustomQuery(&$event)
+	{
+		parent::SetCustomQuery($event);
+
+		$object =& $event->getObject();
+		/* @var $object kDBList */
+
+		if (in_array($event->Special, Array ('enabled', 'selected', 'available')) || !$this->Application->isAdminUser) {
+			// "enabled" special or Front-End
+			$object->addFilter('enabled_filter', '%1$s.Status = ' . STATUS_ACTIVE);
+		}
+
+		// site domain payment type picker
+		if ($event->Special == 'selected' || $event->Special == 'available') {
+			$edit_picker_helper =& $this->Application->recallObject('EditPickerHelper');
+			/* @var $edit_picker_helper EditPickerHelper */
+
+			$edit_picker_helper->applyFilter($event, 'PaymentTypes');
+		}
+
+		// apply domain-based payment type filtering
+		$payment_types = $this->Application->siteDomainField('PaymentTypes');
+
+		if (strlen($payment_types)) {
+			$payment_types = explode('|', substr($payment_types, 1, -1));
+			$object->addFilter('domain_filter', '%1$s.PaymentTypeId IN (' . implode(',', $payment_types) . ')');
+		}
+	}
+
 }
\ No newline at end of file
Index: in-commerce/units/sections/section_eh.php
===================================================================
--- in-commerce/units/sections/section_eh.php	(revision 0)
+++ in-commerce/units/sections/section_eh.php	(revision 0)
@@ -0,0 +1,101 @@
+<?php
+/**
+* @version	$Id$
+* @package	In-Commerce
+* @copyright	Copyright (C) 1997 - 2010 Intechnic. All rights reserved.
+* @license	Commercial License
+* This software is protected by copyright law and international treaties.
+* Unauthorized reproduction or unlicensed usage of the code of this program,
+* or any portion of it may result in severe civil and criminal penalties,
+* and will be prosecuted to the maximum extent possible under the law
+* See http://www.in-portal.org/commercial-license for copyright notices and details.
+*/
+
+	defined('FULL_PATH') or die('restricted access!');
+
+	class InCommerceEventHandler extends kEventHandler {
+
+		/**
+		 * [HOOK] Creates site domain editing tab
+		 *
+		 * @param kEvent $event
+		 */
+		function OnModifySiteDomainConfig(&$event)
+		{
+			$edit_tab_presets = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'EditTabPresets');
+			$edit_tab_presets['Default']['in-commerce'] = Array (
+				'title' => 'la_title_In-Commerce', 't' => 'in-commerce/site_domains/site_domain_edit', 'priority' => 2.1
+			);
+			$this->Application->setUnitOption($event->MasterEvent->Prefix, 'EditTabPresets', $edit_tab_presets);
+
+			$title_presets = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'TitlePresets');
+			$title_presets['site_domain_edit_in_commerce'] = Array (
+				'prefixes' => Array ('site-domain'), 'format' => "#site-domain_status# '#site-domain_titlefield#' - !la_title_In-Commerce!",
+				'toolbar_buttons' => Array ('select', 'cancel', 'reset_edit', 'prev', 'next'),
+			);
+			$this->Application->setUnitOption($event->MasterEvent->Prefix, 'TitlePresets', $title_presets);
+
+			$new_fields = Array (
+				'BillingCountry' => Array (
+					'type' => 'string', 'max_len' => 3,
+					'formatter' => 'kOptionsFormatter',
+					'options_sql' => '	SELECT IF(l%2$s_Name = "", l%3$s_Name, l%2$s_Name) AS Name, IsoCode
+										FROM ' . TABLE_PREFIX . 'CountryStates
+										WHERE Type = ' . DESTINATION_TYPE_COUNTRY . '
+										ORDER BY Name',
+					'option_key_field' => 'IsoCode', 'option_title_field' => 'Name',
+					'not_null' => 1, 'default' => ''
+				),
+				'ShippingCountry' => Array (
+					'type' => 'string', 'max_len' => 3,
+					'formatter' => 'kOptionsFormatter',
+					'options_sql' => '	SELECT IF(l%2$s_Name = "", l%3$s_Name, l%2$s_Name) AS Name, IsoCode
+										FROM ' . TABLE_PREFIX . 'CountryStates
+										WHERE Type = ' . DESTINATION_TYPE_COUNTRY . '
+										ORDER BY Name',
+					'option_key_field' => 'IsoCode', 'option_title_field' => 'Name',
+					'not_null' => 1, 'default' => ''
+				),
+				'PrimaryCurrencyId' => Array (
+					'type' => 'int',
+					'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Currencies WHERE Status = 1 ORDER BY ISO', 'option_key_field' => 'CurrencyId', 'option_title_field' => 'Name', 'use_phrases' => 1,
+					'not_null' => 1, 'default' => 0
+				),
+				'Currencies' => Array (
+					'type' => 'string', 'max_len' => 255,
+					'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'Currencies WHERE Status = 1 ORDER BY ISO', 'option_key_field' => 'CurrencyId', 'option_title_field' => 'Name', 'use_phrases' => 1,
+					'not_null' => 1, 'default' => ''
+				),
+				'PrimaryPaymentTypeId' => Array (
+					'type' => 'int',
+					'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PaymentTypes WHERE Status = 1 ORDER BY Name ASC', 'option_key_field' => 'PaymentTypeId', 'option_title_field' => 'Name',
+					'not_null' => 1, 'default' => 0
+				),
+				'PaymentTypes' => Array (
+					'type' => 'string', 'max_len' => 255,
+					'formatter' => 'kOptionsFormatter', 'options_sql' => 'SELECT %s FROM ' . TABLE_PREFIX . 'PaymentTypes WHERE Status = 1 ORDER BY Name ASC', 'option_key_field' => 'PaymentTypeId', 'option_title_field' => 'Name',
+					'not_null' => 1, 'default' => ''
+				),
+			);
+
+			$fields = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Fields');
+			$this->Application->setUnitOption($event->MasterEvent->Prefix, 'Fields', array_merge_recursive2($fields, $new_fields));
+
+			$new_columns = Array (
+				'BillingCountry' => Array ('title' => 'la_col_BillingCountry', 'filter_block' => 'grid_options_filter', 'width' => 250, ),
+				'ShippingCountry' => Array ('title' => 'la_col_ShippingCountry', 'filter_block' => 'grid_options_filter', 'width' => 250, ),
+				'PrimaryCurrencyId' => Array ('title' => 'la_col_Currency', 'filter_block' => 'grid_options_filter', 'width' => 250, ),
+				'PrimaryPaymentTypeId' => Array ('title' => 'la_col_PaymentType', 'filter_block' => 'grid_options_filter', 'width' => 250, ),
+			);
+
+			$grids = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Grids');
+			$grids['Default']['Fields'] = array_merge_recursive2($grids['Default']['Fields'], $new_columns);
+			$this->Application->setUnitOption($event->MasterEvent->Prefix, 'Grids', $grids);
+
+			if (!$this->Application->isAdmin) {
+				// re-configure object, because it's recalled before kUnitConfigReader::AfterConfigRead is called
+				$this->Application->siteDomain->defineFields();
+			}
+		}
+
+	}
Index: in-commerce/units/sections/sections_config.php
===================================================================
--- in-commerce/units/sections/sections_config.php	(revision 0)
+++ in-commerce/units/sections/sections_config.php	(revision 0)
@@ -0,0 +1,34 @@
+<?php
+/**
+* @version	$Id$
+* @package	In-Commerce
+* @copyright	Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
+* @license	Commercial License
+* This software is protected by copyright law and international treaties.
+* Unauthorized reproduction or unlicensed usage of the code of this program,
+* or any portion of it may result in severe civil and criminal penalties,
+* and will be prosecuted to the maximum extent possible under the law
+* See http://www.in-portal.org/commercial-license for copyright notices and details.
+*/
+
+	defined('FULL_PATH') or die('restricted access!');
+
+	$config = Array (
+		'Prefix' => 'in-commerce-sections',
+
+		'EventHandlerClass' => Array ('class' => 'InCommerceEventHandler', 'file' => 'section_eh.php', 'build_event' => 'OnBuild'), // for OnAfterConfigRead event
+		'TagProcessorClass' => Array ('class' => 'kTagProcessor', 'file' => '', 'build_event' => 'OnBuild'), // for tree drawing
+
+		'Hooks' => Array (
+			Array (
+				'Mode' => hAFTER,
+				'Conditional' => false,
+				'HookToPrefix' => 'site-domain',
+				'HookToSpecial' => '*',
+				'HookToEvent' => Array ('OnAfterConfigRead'),
+				'DoPrefix' => '',
+				'DoSpecial' => '*',
+				'DoEvent' => 'OnModifySiteDomainConfig',
+			),
+		),
+	);
