Skip to content

Commit

Permalink
Merge pull request #16583 from ksar-ksar/13.0
Browse files Browse the repository at this point in the history
FIX : #16341 : Fetch the Product ExtraFields in Shippment lines
  • Loading branch information
eldy authored Mar 8, 2021
2 parents 142f878 + ec8baa6 commit fe7fa49
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions htdocs/core/class/commondocgenerator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,15 @@ public function get_substitutionarray_shipment_lines($line, $outputlangs)

$resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs);

// Load product data optional fields to the line -> enables to use "line_product_options_{extrafield}"
if (isset($line->fk_product) && $line->fk_product > 0)
{
$tmpproduct = new Product($this->db);
$result = $tmpproduct->fetch($line->fk_product);
foreach ($tmpproduct->array_options as $key=>$label)
$resarray["line_product_".$key] = $label;
}

return $resarray;
}

Expand Down

0 comments on commit fe7fa49

Please sign in to comment.