Description - The package group to which all TLD packages will be assigned.
But there’s no such setting at admin/plugin/domains/admin_domains/configuration/?tab=advanced
Anyway, the default value is 1, in the company_settings table.
The setup workflow is somehow by design stealth, maybe for the benefit of non-advanced user setups.
This default package group is hidden at admin/packages/groups/ ( becomes visible by Toggle filters with Show Hidden Package Groups )
By default, creating a TLD assign this domain package group via private function createPackage(array $vars), from plugins\domains\models\domains_tlds.php
// Set package group id
if (!isset($vars['package_group_id'])) {
$domains_package_group = $this->Companies->getSetting(
$vars['company_id'],
'domains_package_group'
);
Let’s imagine the scenario in which I would like to have another domain package group, in order to set up a different order form.
You would have to find the hidden package admin/packages/ ( by Toggle filters with Show Hidden Packages) , and assign a different group membership.
The downside of working with different domain package groups from the company setting, is that you miss all the cron goodies.
Let's take a look at the cron task from plugins\domains\domains_plugin.php ( listed in GUI at /admin/settings/company/plugins/settings/IdPlugin/automation/ ), the services are restricted to $settings['domains_package_group'] of the company
private function cronDomainTermChange()
// Find all domain services that do not have a 1 year pricing term
$services = $this->Services->getAll(
['date_added' => 'DESC'],
true,
[
'package_group_id' => $settings['domains_package_group'],
'excluded_pricing_term' => 1,
'pricing_period' => 'year'
]
);
This was the very first one that caught my attention. Hacking by eliminating the condition $meta['domain_group'] == $domains_package_group->value would do the job, but , for the rest, it seems too much to hack.
private function addTldPackageGroup from plugins\domains\domains_plugin.php, // Check if there is a package group collision between all system companies, I would assume that, by design, there should be one package domain group per company.
Add a package group for hiding and managing TLDs
// Check if there is a package group collision between all system companies
$domains_package_group = $this->Companies->getSetting($company_id, 'domains_package_group');
$companies = $this->Companies->getAll();
foreach ($companies as $company) {
$company_domains_package_group = $this->Companies->getSetting($company->id, 'domains_package_group');
if ($company_domains_package_group->value == $domains_package_group->value && $company->id != $company_id) {
// A collision was found, unset the domains_package_group setting for the current company
$this->Companies->unsetSetting($company_id, 'domains_package_group');
break;
}
}
Including import package private function importPackage(
On the other hand, public function getSettings(array $vars = null) from plugins\order\lib\order_types\domain\order_type_domain.php, this takes into the account the other custom group.
// If the "Domain Manager" plugin is installed, then default to it's package group for domain order forms
$domain_package_group = $this->Companies->getSetting(
Configure::get('Blesta.company_id'),
'domains_package_group'
);
if (!isset($vars['meta']['domain_group']) && $domain_package_group) {
$vars['meta']['domain_group'] = $domain_package_group->value;
}
In order to fit this architecture, I should assign all TLDs to a single domain package group. But, in this case, could I have different order forms for different domain groups?
By design, it seems that there is for each company only one TLD package group . I would enjoy the flexibility for a single company to have multiple order forms with domains.
Question
EuroDomenii
Before jumping into domain package group architecture, I didn’t find a way to change the default value from interface https://docs.blesta.com/display/user/Domain+Manager#DomainManager-Advanced Here it says:
But there’s no such setting at admin/plugin/domains/admin_domains/configuration/?tab=advanced
Anyway, the default value is 1, in the company_settings table.
The setup workflow is somehow by design stealth, maybe for the benefit of non-advanced user setups.
This default package group is hidden at admin/packages/groups/ ( becomes visible by Toggle filters with Show Hidden Package Groups )
By default, creating a TLD assign this domain package group via private function createPackage(array $vars), from plugins\domains\models\domains_tlds.php
// Set package group id if (!isset($vars['package_group_id'])) { $domains_package_group = $this->Companies->getSetting( $vars['company_id'], 'domains_package_group' );
Let’s imagine the scenario in which I would like to have another domain package group, in order to set up a different order form.
You would have to find the hidden package admin/packages/ ( by Toggle filters with Show Hidden Packages) , and assign a different group membership.
The downside of working with different domain package groups from the company setting, is that you miss all the cron goodies.
Let's take a look at the cron task from plugins\domains\domains_plugin.php ( listed in GUI at /admin/settings/company/plugins/settings/IdPlugin/automation/ ), the services are restricted to $settings['domains_package_group'] of the company
private function synchronizeDomains() $company_id = Configure::get('Blesta.company_id'); $settings = $this->Form->collapseObjectArray($this->Companies->getSettings($company_id), 'value', 'key'); if (!isset($settings['domains_package_group'])) { return; } // Find all domain services $services = $this->Services->getAll( ['date_added' => 'DESC'], true, ['package_group_id' => $settings['domains_package_group']] );
private function cronDomainTermChange() // Find all domain services that do not have a 1 year pricing term $services = $this->Services->getAll( ['date_added' => 'DESC'], true, [ 'package_group_id' => $settings['domains_package_group'], 'excluded_pricing_term' => 1, 'pricing_period' => 'year' ] );
private function cronDomainRenewalReminders() // Fetch all qualifying services $services = $this->Services->getAll( ['date_added' => 'DESC'], true, [], [ 'services' => [ 'package_group_id' => $settings['domains_package_group'], ['column' => 'date_renews', 'operator' => '>=', 'value' => $start_date], ['column' => 'date_renews', 'operator' => '<=', 'value' => $end_date] ] ] );
Even the spotlight_tlds work only for one company domain_package_group.
if (!empty($spotlight_tlds) && $domains_package_group && $meta['domain_group'] == $domains_package_group->value ) { $this->view->set('spotlight_tlds', $spotlight_tlds); }
This was the very first one that caught my attention. Hacking by eliminating the condition $meta['domain_group'] == $domains_package_group->value would do the job, but , for the rest, it seems too much to hack.
private function addTldPackageGroup from plugins\domains\domains_plugin.php, // Check if there is a package group collision between all system companies, I would assume that, by design, there should be one package domain group per company. Add a package group for hiding and managing TLDs // Check if there is a package group collision between all system companies $domains_package_group = $this->Companies->getSetting($company_id, 'domains_package_group'); $companies = $this->Companies->getAll(); foreach ($companies as $company) { $company_domains_package_group = $this->Companies->getSetting($company->id, 'domains_package_group'); if ($company_domains_package_group->value == $domains_package_group->value && $company->id != $company_id) { // A collision was found, unset the domains_package_group setting for the current company $this->Companies->unsetSetting($company_id, 'domains_package_group'); break; } }
Including import package private function importPackage(
On the other hand, public function getSettings(array $vars = null) from plugins\order\lib\order_types\domain\order_type_domain.php, this takes into the account the other custom group.
// If the "Domain Manager" plugin is installed, then default to it's package group for domain order forms $domain_package_group = $this->Companies->getSetting( Configure::get('Blesta.company_id'), 'domains_package_group' ); if (!isset($vars['meta']['domain_group']) && $domain_package_group) { $vars['meta']['domain_group'] = $domain_package_group->value; }
In order to fit this architecture, I should assign all TLDs to a single domain package group. But, in this case, could I have different order forms for different domain groups?
By design, it seems that there is for each company only one TLD package group . I would enjoy the flexibility for a single company to have multiple order forms with domains.
Thx!
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.