NEW. Dodanie opcji typ pola własnego
This commit is contained in:
@@ -1,13 +1,20 @@
|
||||
<? if ( $this -> custom_fields ): foreach ( $this -> custom_fields as $key => $val ):?>
|
||||
<div class="custom-field">
|
||||
<div class="_name">
|
||||
<?
|
||||
$custom_field = \shop\ProductCustomField::getFromCache( $key );
|
||||
echo $custom_field['name'] . ':';
|
||||
?>
|
||||
</div>
|
||||
<div class="_text">
|
||||
<?= $val;?>
|
||||
</div>
|
||||
</div>
|
||||
<? endforeach; endif;?>
|
||||
<? if ( $this -> custom_fields ) : ?>
|
||||
<? foreach ( $this -> custom_fields as $key => $val ) : ?>
|
||||
<? $custom_field = \shop\ProductCustomField::getFromCache( $key ); ?>
|
||||
|
||||
<? if ( $custom_field['type'] == 'text' ) : ?>
|
||||
<div class="custom-field">
|
||||
<div class="_name">
|
||||
<?
|
||||
echo $custom_field['name'] . ':';
|
||||
?>
|
||||
</div>
|
||||
<div class="_text">
|
||||
<?= $val;?>
|
||||
</div>
|
||||
</div>
|
||||
<? elseif ( $custom_field['type'] == 'image' ) : ?>
|
||||
|
||||
<? endif; ?>
|
||||
<? endforeach; ?>
|
||||
<? endif;?>
|
||||
@@ -1,10 +1,23 @@
|
||||
<? if ( is_array( $this -> custom_fields ) ): foreach ( $this -> custom_fields as $custom_field ):?>
|
||||
<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>
|
||||
<? endforeach; endif;?>
|
||||
<? 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;?>
|
||||
Reference in New Issue
Block a user