diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index e72c4427f08..e16f64d1515 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -233,7 +233,7 @@ if (isModEnabled('product')) {
print '';
print '
'.$modBarCode->getExample($langs)." | \n";
- if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') && $conf->global->BARCODE_PRODUCT_ADDON_NUM == "$file") {
+ if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM') == "$file") {
print '';
print img_picto($langs->trans("Activated"), 'switch_on');
print ' | ';
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index 5edc67dda71..de1f4f96e4d 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -184,7 +184,7 @@ if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
if (preg_match('/^mod_barcode_product_.*php$/', $file)) {
$file = substr($file, 0, dol_strlen($file) - 4);
- if ($file == $conf->global->BARCODE_PRODUCT_ADDON_NUM) {
+ if ($file == getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
try {
dol_include_once($dirroot.$file.'.php');
} catch (Exception $e) {
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index c418ac59c21..ba92ea90cf4 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1279,7 +1279,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-product page-card');
// Load object modBarCodeProduct
$res = 0;
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
- $module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
+ $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM'));
$dirbarcode = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirbarcode as $dirroot) {
$res = dol_include_once($dirroot.$module.'.php');
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index a492d384432..50b65edf285 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1036,7 +1036,7 @@ class Product extends CommonObject
// phpcs:enable
global $conf;
if (isModEnabled('barcode') && getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
- $module = strtolower($conf->global->BARCODE_PRODUCT_ADDON_NUM);
+ $module = strtolower(getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM'));
$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
foreach ($dirsociete as $dirroot) {