Jump to content

Prestashop User group 'group' form helper in custom module


fancy|modules

Recommended Posts

I wanto to use Customer group componnet (I find it in AdminPattern controller) in my module in from helper method. I can save checked checkboxes to configuration table (I serialized array and save options as text) but cant load saved values back to form.

array(
                    'type' => 'group',
                    'label' => 'group',
                    'name' => 'configuration[]',
                    'values' => Group::getGroups(Context::getContext()->language->id),
                ),

In post process:

if (Tools::isSubmit('submitTallerOrden'))
    {
        $_POST['configuration'] = implode(',', Tools::getValue('configuration'));
    }

in render form I have:

$this->fields_value['configuration[]'] = explode(',',$obj->configuration);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...