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

Révisions

Articles récemment édités
Ce site n'utilise aucun cookie ni aucune technologie de suivi tierce. Nous pensons pouvoir faire mieux que les autres et nous nous soucions vraiment de votre vie privée.