Categories
Categories are groups of products that makes it easier to browse and maintain your products.
Entity Object
$category = new ent_category();
$category->data['name']['en'] = 'Rubber Ducks';
$category->save();
Reference Model
echo reference::category($category_id)->name;
Database Query
$category = database::query(
"select c.id, ci.name from ". DB_TABLE_PREFIX ."categories c
left join ". DB_TABLE_PREFIX ."categories_info ci on (ci.category_id = c.id and ci.language_code = 'en')
where c.id = ". (int)$category_id ."
limit 1;"
)->fetch();
$categories = database::query(
"select c.id, ci.name from ". DB_TABLE_PREFIX ."categories c
left join ". DB_TABLE_PREFIX ."categories_info ci on (ci.category_id = c.id and ci.language_code = 'en')
order by ci.name;"
)->fetch_all();