diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index eedb994baed..731f8859eba 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -97,7 +97,7 @@ function product_prepare_head($object) $head[$h][2] = 'referers'; $h++; - if (!empty($conf->variants->enabled) && $object->isProduct()) { + if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { global $db; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 549eca022b0..a0ab4508d9c 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1771,7 +1771,7 @@ else } //Parent product. - if (!empty($conf->variants->enabled) && $object->isProduct()) { + if (!empty($conf->variants->enabled) && ($object->isProduct() || $object->isService())) { $combination = new ProductCombination($db); diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 04f53e55d21..3460718c680 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -71,7 +71,7 @@ if ($cancel) { unset($_SESSION['addvariant_'.$object->id]); } -if (! $object->isProduct()) { +if (! $object->isProduct() && ! $object->isService()) { header('Location: '.dol_buildpath('/product/card.php?id='.$object->id, 2)); exit(); } @@ -523,12 +523,13 @@ if (! empty($id) || ! empty($ref))