This Hook used to register categorySet.
Step1: Register Call call back. See below format:
App::Module('Hook')
->setHookName("CategorySet")
->setAction("register_definition")
->Register(Call Back Class Name, Call Back Function Name);
Name |
Type |
Description |
---|---|---|
Call Back Class Name |
Mandatory |
Class Name of call back function |
Call Back Function Name |
Mandatory |
Call back function |
Step 2: Register resource in Call back function:
In call back function we return an array with categorySet information like below
$srcpaths[] = array(
'type'=>Name,
"'path"=>Path
);
Name |
Type |
Description |
---|---|---|
Name |
Mandatory |
Name of the CategorySet |
Path |
Mandatory |
CategorySet file path |
See below example:
class Component_Appstore_Register extends appRain_Base_Component
{
public function init(){
App::Module('Hook')
->setHookName('CategorySet')
->setAction("register_definition")
->Register(get_class($this),"register_categoryset_defination");
}
public function register_categoryset_defination()
{
$srcpaths = Array();
$srcpaths[] = array(
'type'=>'product-cat',
'path'=>$this->attachMyPath('category_set/product-cat.xml')
);
$srcpaths[] = array(
'type'=>'shippingrole',
'path'=>$this->attachMyPath('category_set/shippingrole.xml')
);
return $srcpaths;
}
}