MasterEvent->getUnitConfig(); $master_config->addEditTabPresetTabs('Default', Array ( 'in-commerce' => Array ( 'title' => 'la_title_In-Commerce', 't' => 'in-commerce/site_domains/site_domain_edit', 'priority' => 2.1 ), )); $master_config->addTitlePresets(Array ( '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'), ), )); $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' => '' ), ); $master_config->addFields($new_fields); $new_columns = Array ( 'BillingCountry' => Array ('filter_block' => 'grid_options_filter', 'width' => 250, ), 'ShippingCountry' => Array ('filter_block' => 'grid_options_filter', 'width' => 250, ), 'PrimaryCurrencyId' => Array ('title' => 'column:la_fld_Currency', 'filter_block' => 'grid_options_filter', 'width' => 250, ), 'PrimaryPaymentTypeId' => Array ('title' => 'column:la_fld_PaymentType', 'filter_block' => 'grid_options_filter', 'width' => 250, ), ); $master_config->addGridFields('Default', $new_columns); if (!$this->Application->isAdmin && is_object($this->Application->siteDomain)) { // re-configure object, because it's recalled before kUnitConfigReader::AfterConfigRead is called $this->Application->siteDomain->Configure(); } } }