Poprawa sprawdzania, czy 'products_related' jest tablicą przed użyciem w selektorze produktów

This commit is contained in:
2024-12-29 20:31:36 +01:00
parent e8ca4f89b4
commit 8c2f10dd5b

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>