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();

Revisionen

kürzlich bearbeitete Artikel
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.