Quantity Units

Assign the unit for the quantity of products you are selling. Wheither it's pcs, meters, kilograms, or something else.

Entity Object

$quantity_unit = new ent_quantity_unit();
$quantity_unit->data['name']['en'] = 'Kilograms;
$quantity_unit->save();

Reference Model

Quantity units doesn't have a reference object. Instead, values from the entity will be returned.

echo reference::quantity_unit($quantity_unit_id)->name[$language_code];

Database Query

$quantity_unit = database::query(
  "select qu.id, qui.name from ". DB_TABLE_PREFIX ."quantity_units qu
  left join ". DB_TABLE_PREFIX ."quantity_units_info qui on (qui.quantity_unit_id = qu.id and qui.language_code = 'en')
  where qu.id = ". (int)$quantity_unit_id ."
  limit 1;"
)->fetch();

Revisions

Recently Edited Articles
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.