60 lines
1.9 KiB
PHP
60 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace KupShop\B2BBundle;
|
|
|
|
use KupShop\KupShopBundle\Config;
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
|
|
|
class B2BBundle extends Bundle
|
|
{
|
|
public function boot()
|
|
{
|
|
parent::boot();
|
|
$cfg = &Config::get()->getContainer();
|
|
|
|
$cfg['Modules']['users_groups_types'] = array_merge($cfg['Modules']['users_groups_types'] ?? [], [
|
|
'b2b' => ['name' => 'B2B'],
|
|
]);
|
|
|
|
$cfg['Modules']['info_panels']['types'] = array_merge($cfg['Modules']['info_panels']['types'] ?? [], [
|
|
[
|
|
'type' => 'b2b',
|
|
'descr' => 'B2B',
|
|
],
|
|
]);
|
|
|
|
$cfg['Modules']['pricelists'] = true;
|
|
|
|
if (!findModule(\Modules::XML_FEEDS_B2B)) {
|
|
$cfg['Modules']['xml_feeds_b2b'] = true;
|
|
}
|
|
|
|
if (!findModule(\Modules::B2B, \Modules::SUB_OLD)) {
|
|
$cfg['Modules']['products'] = array_merge($cfg['Modules']['products'], ['modern_prices' => true]);
|
|
}
|
|
|
|
if (empty($cfg['Order']['Flags']['B2B'])) {
|
|
$cfg['Order']['Flags']['B2B'] = ['name' => 'B2B'];
|
|
}
|
|
|
|
$cfg['Modules']['forms'] = array_merge($cfg['Modules']['forms'] ?? [],
|
|
['registration-b2b-default' => [
|
|
'title' => 'Registrace B2B',
|
|
'template' => 'form/registration-b2b.tpl',
|
|
'message' => 'email/registration-b2b.tpl',
|
|
'subject' => 'email/registration-b2b_subject.tpl',
|
|
'message_answer' => 'email/registration-b2b_answer.tpl',
|
|
'subject_answer' => 'email/registration-b2b_subject_answer.tpl',
|
|
],
|
|
]
|
|
);
|
|
|
|
// B2B modul to zapina, ale je potreba to jeste pridat do cfg
|
|
if (empty($cfg['Modules']['xml_feeds_b2b'])) {
|
|
$cfg['Modules']['xml_feeds_b2b'] = [
|
|
'secure' => true,
|
|
];
|
|
}
|
|
}
|
|
}
|