// b2b fixed

This commit is contained in:
aFolletete
2012-01-11 16:39:40 +00:00
parent 62a71b2be0
commit 3e726af4ef
@@ -160,6 +160,13 @@ class AdminPreferencesControllerCore extends AdminController
'default' => '480', 'default' => '480',
'visibility' => Shop::CONTEXT_ALL '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( 'PS_ORDER_PROCESS_TYPE' => array(
'title' => $this->l('Order process type'), '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'), 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'),
@@ -428,4 +435,25 @@ class AdminPreferencesControllerCore extends AdminController
$value = ($max_size < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $max_size : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE'); $value = ($max_size < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE')) ? $max_size : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE');
Configuration::update('PS_ATTACHMENT_MAXIMUM_SIZE', $value); 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);
}
} }