Jump to content

Set checkboxes checked in module helper checkbox tree


completepresta

Recommended Posts

Hi, does someone know how i can set the checkboxes checked in my module helper checkbox tree?

Now i have the following but it does not work:

In my Fields form array

$selected_coupon_categories = @unserialize(Configuration::get($this->module_name.'_COUPON_CATEGORIES', NULL, $id_shop_group, $id_shop));
if($selected_coupon_categories === false && $selected_coupon_categories !== 'b:0;') {
   $selected_coupon_categories = array();
}

$tree->setUseCheckBox(false)->
setUseCheckBox(1)->
setAttribute('is_category_filter', 2)->
setRootCategory(2)->
setAttribute('id', 'expand-all-2')->
setSelectedCategories($selected_coupon_categories);

And in check post and get params

$categories = @unserialize(Configuration::get($this->module_name.'_COUPON_CATEGORIES', NULL, $id_shop_group, $id_shop));
if($categories === false && $categories !== 'b:0;') {
    $categories = array();
}
				
$fields = array(					
    'categoryBox' => $categories
);

 Both does not work :(

 

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...