[+] Project : B2B Features

This commit is contained in:
jBreux
2011-12-22 15:30:21 +00:00
parent 171d7c61cb
commit 4eb9edf698
18 changed files with 984 additions and 19 deletions
@@ -156,6 +156,13 @@ class AdminPreferencesControllerCore extends AdminController
'default' => '480',
'visibility' => Shop::CONTEXT_ALL
),
'PS_B2B_ENABLE' => array(
'title' => $this->l('Enable B2B mode'),
'desc' => $this->l('Activate or deactivate B2B mode. When this option is enable some features about B2B appear.'),
'validation' => 'isBool',
'cast' => 'intval',
'type' => 'bool'
),
'PS_ORDER_PROCESS_TYPE' => array(
'title' => $this->l('Order process type'),
'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'),
@@ -389,4 +396,25 @@ class AdminPreferencesControllerCore extends AdminController
$value = ($max_size < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $max_size : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE');
Configuration::update('PS_ATTACHMENT_MAXIMUM_SIZE', $value);
}
/**
* Update PS_B2B_ENABLE and enables / disables the associated tabs
* @param $value integer Value of option
*/
public function updateOptionPsB2bEnable($value)
{
$value = (int)$value;
$tabs_class_name = array('AdminOutstanding');
if (!empty($tabs_class_name)) {
foreach ($tabs_class_name as $tab_class_name) {
$tab = Tab::getInstanceFromClassName($tab_class_name);
if (Validate::isLoadedObject($tab)) {
$tab->active = $value;
$tab->save();
}
}
}
Configuration::updateValue('PS_B2B_ENABLE', $value);
}
}