Files
shopPRO/templates/shop-product/_partial/product-custom-fields.php
2026-01-20 11:33:18 +01:00

23 lines
1.2 KiB
PHP

<? if ( is_array( $this -> custom_fields ) ) : ?>
<? foreach ( $this -> custom_fields as $custom_field ): ?>
<? if ( $custom_field['type'] == 'text' ) : ?>
<div class="custom-field">
<div class="_name">
<?= $custom_field['name'];?><? if ( !empty( $custom_field['is_required'] ) ): ?>*<? endif; ?>:
</div>
<div class="_input">
<input type="text" class="form-control" name="custom_field[<?= $custom_field['id_additional_field'];?>]" field_name="<?= $custom_field['name'];?>" value="" <? if ( !empty( $custom_field['is_required'] ) ): ?>required<? endif; ?>>
</div>
</div>
<? elseif ( $custom_field['type'] == 'image' ) : ?>
<div class="custom-field">
<div class="_name">
<?= $custom_field['name'];?><? if ( !empty( $custom_field['is_required'] ) ): ?>*<? endif; ?>:
</div>
<div class="_input">
<input type="file" class="form-control-file" name="custom_field[<?= $custom_field['id_additional_field'];?>]" field_name="<?= $custom_field['name'];?>" src="" alt="" <? if ( !empty( $custom_field['is_required'] ) ): ?>required<? endif; ?>>
</div>
</div>
<? endif; ?>
<? endforeach; ?>
<? endif;?>