Dodanie sprawdzenia, czy 'products_related' jest tablicą przed zaznaczeniem opcji w formularzu edycji produktu

This commit is contained in:
2024-12-29 20:31:42 +01:00
parent 91484467fc
commit 2e84ff623a

View File

@@ -589,7 +589,7 @@ ob_start();
<option value="">wybierz produkt...</option>
<? foreach ($this->products as $key => $val) : ?>
<? if ($key != $this->product['id']) : ?>
<option value="<?= $key; ?>" <? if (in_array($key, $this->product['products_related'])) : ?>selected<? endif; ?>><?= $val; ?></option>
<option value="<?= $key; ?>" <? if ( is_array( $this -> product['products_related'] ) and in_array($key, $this->product['products_related'])) : ?>selected<? endif; ?>><?= $val; ?></option>
<? endif; ?>
<? endforeach; ?>
</select>