Merge pull request #24268 from bloxera/fix_for_extrafields_parseexpression

Fix #24267: loading the extrafields of the related product in dynamic price expression
This commit is contained in:
Laurent Destailleur 2023-03-19 14:18:44 +01:00 committed by GitHub
commit df6dfc34e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,11 +156,10 @@ class PriceParser
//Retrieve all extrafield for product and add it to values
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($product->table_element);
$product->fetch_optionals();
if (is_array($extrafields->attributes[$product->table_element]['label'])) {
foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) {
$values["extrafield_".$key] = $product->array_options['options_'.$key];
}
foreach ($extralabels as $key => $label) {
$values["extrafield_".$key] = $product->array_options['options_'.$key];
}
//Process any pending updaters