Jump to content

Baudo

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • First Name
    TEST
  • Last Name
    TEST

Baudo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. another question, when I create the group have all modolu deactivated for that group, how do I turn them all?
  2. Thanks for the suggestion, I have another question, if I want to assign a new user to that category, as do the id of the right category? Work? function hookCreateAccount($params) { $customer = $params['newCustomer']; $idcategory = Configuration::get("MY_MODULE_ID-GROUP") $customer->addGroups($idcategory); } public function install() { $languages = Language::getLanguages(); $group_names = array( 'en' => 'New Group' ); $group = new Group(); $group->reduction = 20.00; $group->price_display_method = PS_TAX_INC; // or PS_TAX_EXC $group->show_prices = true; $group->name = array(); foreach ($languages as $lang){ $id_lang = $lang['id_lang']; $iso_lang = $lang['iso_code']; $group->name[$id_lang] = isset($group_names[$iso_lang]) ? $group_names[$iso_lang] : $group_names['en']; } $group->save(); Configuration::updateValue('MY_MODULE_ID-GROUP', $group->id); //work after save? return parent::install() && $this->registerHook('createAccount'); }
  3. Hi everyone, I want that when I install my module is added a new group for users. I try this: $sql = array(); $sql[] = 'INSERT INTO `'._DB_PREFIX_.'group` (reduction,price_display_method,show_prices) VALUES (0.00, 0, 1)'; $idgroup = Db::getInstance()->getValue("SELECT MAX(id) FROM `"._DB_PREFIX_."group`"); foreach ($sql as $query) if (Db::getInstance()->execute($query) == false) return false; in $idgroup I have the id of my group, now I have to put the names in the ps_group_lang with the id of the language, is correct?
×
×
  • Create New...