This commit is contained in:
2026-03-19 19:35:09 +01:00
parent 3a716ab25e
commit 9c2932dad1
10 changed files with 60 additions and 30 deletions

View File

@@ -1,20 +1,26 @@
<? if ( $this -> custom_fields ) : ?>
<? foreach ( $this -> custom_fields as $key => $val ) : ?>
<? $custom_field = ( new \Domain\Product\ProductRepository( $GLOBALS['mdb'] ) )->findCustomFieldCached( $key ); ?>
<? if ( $custom_field['type'] == 'text' ) : ?>
<? $field_type = !empty( $custom_field['type'] ) ? $custom_field['type'] : 'text'; ?>
<? if ( $field_type == 'text' ) : ?>
<div class="custom-field">
<div class="_name">
<?
echo $custom_field['name'] . ':';
?>
<?= htmlspecialchars( $custom_field['name'] ) . ':'; ?>
</div>
<div class="_text">
<?= $val;?>
<?= nl2br( htmlspecialchars( $val ) );?>
</div>
</div>
<? elseif ( $field_type == 'image' && !empty( $val ) ) : ?>
<div class="custom-field">
<div class="_name">
<?= htmlspecialchars( $custom_field['name'] ) . ':'; ?>
</div>
<div class="_image">
<img src="<?= htmlspecialchars( $val );?>" alt="<?= htmlspecialchars( $custom_field['name'] );?>">
</div>
</div>
<? elseif ( $custom_field['type'] == 'image' ) : ?>
<? endif; ?>
<? endforeach; ?>
<? endif;?>