Skip to main content


Product Categories are typically created by the owner of the store to group product together.


//create a new category
$category = Category::create(
'position' => $position,
'code' => $code

Add a child category

//create a new category
$category = Category::getById($id, $user);

Find a category

//find category by id
$category = Category::getById(3);
$category = Category::getByUuid('000-000-0000-000');
$category = Category::getById(4, $user);
$category = Category::getBySlug($slug, $user);

Update Category

//update category
$category = Category::getById(4, $user);
$category->name = 'name';
$category->slug = 'slug';

Get all categories

//get all categories
$category = Category::getAll($user, $page, $limit);

Add Products to Category

//add product in category
$category = Category::getById(4);
//result set of products
// remove product from category

Get all products in category

//find message
$category = Category::getById(4);
$category->getProducts($page, $limit);