FIX length, width and height coherence in product table

This commit is contained in:
VESSILLER 2020-01-21 17:49:27 +01:00
parent 041d5aeb46
commit c91ab621b8

View File

@ -819,9 +819,9 @@ class Product extends CommonObject
$this->height = price2num($this->height); $this->height = price2num($this->height);
$this->height_units = trim($this->height_units); $this->height_units = trim($this->height_units);
// set unit not defined // set unit not defined
if ($this->length_units) { $this->width_units = $this->length_units; // Not used yet if (is_numeric($this->length_units)) { $this->width_units = $this->length_units; // Not used yet
} }
if ($this->length_units) { $this->height_units = $this->length_units; // Not used yet if (is_numeric($this->length_units)) { $this->height_units = $this->length_units; // Not used yet
} }
// Automated compute surface and volume if not filled // Automated compute surface and volume if not filled
if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) { if (empty($this->surface) && !empty($this->length) && !empty($this->width) && $this->length_units == $this->width_units) {