Poprawiono sprawdzanie, czy 'products_related' jest tablicą przed użyciem w pliku product-edit.php

This commit is contained in:
2024-12-29 20:31:30 +01:00
parent b0bfda5758
commit 892e1952c6

View File

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