Poprawiono obsługę wartości domyślnej oraz wpływu na cenę produktu, dodając warunki sprawdzające istnienie wartości przed ich użyciem.

This commit is contained in:
2025-07-29 14:40:23 +02:00
parent 3a3464c062
commit f9994cf644

View File

@@ -9,13 +9,13 @@
<div class="row">
<div class="col-lg-6">
<div class="mb20">
<input type="radio" id="default_value<?=$this -> value['id'];?>" name="default_value" value="<?= ( $this -> i - 1 );?>" <? if ( $this -> value['is_default'] ):?>checked<? endif;?>>
<label for="default_value<?=$this -> value['id'];?>">Wartość domyślna</label>
<input type="radio" id="default_value<?= $this -> value ? $this -> value['id'] : '0';?>" name="default_value" value="<?= ( $this -> i - 1 );?>" <? if ( $this -> value and $this -> value['is_default'] ):?>checked<? endif;?>>
<label for="default_value<?= $this -> value ? $this -> value['id'] : '0';?>">Wartość domyślna</label>
</div>
<div class="row form-group">
<div class="col-xs-8">
<div class="input-group">
<input class="form-control" name="impact_on_the_price[]" type="text" value="<?= $this -> value['impact_on_the_price'];?>" placeholder="wpływ na cenę produktu...">
<input class="form-control" name="impact_on_the_price[]" type="text" value="<?= $this -> value ? $this -> value['impact_on_the_price'] : '';?>" placeholder="wpływ na cenę produktu...">
<span class="input-group-addon">
<i class="fa fa-usd"></i>
</span>
@@ -41,8 +41,8 @@
<? if ( $lg['status'] ):?>
<div id="tab<?= $this -> i;?>_<?= $lg['id'];?>" class="tab-pane <? if ( !$z++ ):?>active<? endif;?>">
<? if ( $this -> attribute['type'] == 0 ):?>
<input type="hidden" name="ids[<?= $lg['id'];?>][]" value="<?= $this -> value['id'];?>" />
<input type="text" class="name-<?= $i;?> form-control" name="name[<?= $lg['id'];?>][]" value="<?= $this -> value['languages'][$lg['id']]['name'];?>">
<input type="hidden" name="ids[<?= $lg['id'];?>][]" value="<?= $this -> value ? $this -> value['id'] : '0';?>" />
<input type="text" class="name-<?= $i;?> form-control" name="name[<?= $lg['id'];?>][]" value="<?= $this -> value ? $this -> value['languages'][$lg['id']]['name'] : '';?>">
<? endif;?>
</div>
<? endif;?>