|
@@ -824,12 +824,33 @@ if (empty($reshook))
|
|
|
// Add custom code and origin country into description
|
|
|
if (empty($conf->global->MAIN_PRODUCT_DISABLE_CUSTOMCOUNTRYCODE) && (! empty($prod->customcode) || ! empty($prod->country_code))) {
|
|
|
$tmptxt = '(';
|
|
|
- if (! empty($prod->customcode))
|
|
|
- $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
|
|
- if (! empty($prod->customcode) && ! empty($prod->country_code))
|
|
|
- $tmptxt .= ' - ';
|
|
|
- if (! empty($prod->country_code))
|
|
|
- $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
|
|
+ // Define output language
|
|
|
+ if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) {
|
|
|
+ $outputlangs = $langs;
|
|
|
+ $newlang = '';
|
|
|
+ if (empty($newlang) && GETPOST('lang_id','alpha'))
|
|
|
+ $newlang = GETPOST('lang_id','alpha');
|
|
|
+ if (empty($newlang))
|
|
|
+ $newlang = $object->thirdparty->default_lang;
|
|
|
+ if (! empty($newlang)) {
|
|
|
+ $outputlangs = new Translate("", $conf);
|
|
|
+ $outputlangs->setDefaultLang($newlang);
|
|
|
+ $outputlangs->load('products');
|
|
|
+ }
|
|
|
+ if (! empty($prod->customcode))
|
|
|
+ $tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
|
|
+ if (! empty($prod->customcode) && ! empty($prod->country_code))
|
|
|
+ $tmptxt .= ' - ';
|
|
|
+ if (! empty($prod->country_code))
|
|
|
+ $tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
|
|
+ } else {
|
|
|
+ if (! empty($prod->customcode))
|
|
|
+ $tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode;
|
|
|
+ if (! empty($prod->customcode) && ! empty($prod->country_code))
|
|
|
+ $tmptxt .= ' - ';
|
|
|
+ if (! empty($prod->country_code))
|
|
|
+ $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
|
|
+ }
|
|
|
$tmptxt .= ')';
|
|
|
$desc = dol_concatdesc($desc, $tmptxt);
|
|
|
}
|