From 83ecbef9bc3ec4449262b4b6b8e8ae7371e11617 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 May 2020 13:46:37 +0200 Subject: [PATCH] FIX #13911 #13940 --- htdocs/variants/class/ProductCombination.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index f19c81960db..128c1974c77 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -327,7 +327,10 @@ class ProductCombination $child = new Product($this->db); $child->fetch($this->fk_product_child); $child->price_autogen = $parent->price_autogen; - $child->weight = $parent->weight + $this->variation_weight; + $child->weight = $parent->weight; + if ($this->variation_weight) { // If we must add a delta on weight + $child->weight = ($child->weight ? $child->weight : 0) + $this->variation_weight; + } $child->weight_units = $parent->weight_units; $varlabel = $this->getCombinationLabel($this->fk_product_child); $child->label = $parent->label.$varlabel;