diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 87e86e8e0bc..d58e5f8f742 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -2099,7 +2099,7 @@ else
print '
| '.$langs->trans('DefaultUnitToShow').' | ';
if ($unit !== '') {
- print $langs->trans($unit);
+ print $unit;
}
print ' |
';
}
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 8f2e0973ab3..44fb0865682 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -5387,11 +5387,11 @@ class Product extends CommonObject
$label_type = 'short_label';
}
- $sql = 'select '.$label_type.' from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
+ $sql = 'select '.$label_type.', code from '.MAIN_DB_PREFIX.'c_units where rowid='.$this->fk_unit;
$resql = $this->db->query($sql);
if ($resql && $this->db->num_rows($resql) > 0) {
$res = $this->db->fetch_array($resql);
- $label = $res[$label_type];
+ $label = $label_type == 'short' ? $res[$label_type] : $langs->trans('unit' . $res['code']);
$this->db->free($resql);
return $label;
}