admin/controller/catalog/product.php
найти foreach ($product_specials as $product_special) {
и заменить всё на >>>
foreach ($product_specials as $product_special) {
if (($product_special['date_start'] == '0000-00-00 00:00:00' || strtotime($product_special['date_start']) < time()) && ($product_special['date_end'] == '0000-00-00 00:00:00' || strtotime($product_special['date_end']) > time())) {
$special = $product_special['price'];
break;
}
}
foreach ($product_specials as $product_special) {
Должно получится так >>>
foreach ($product_specials as $product_special) {
$data['product_specials'][] = array(
'customer_group_id' => $product_special['customer_group_id'],
'priority' => $product_special['priority'],
'price' => $product_special['price'],
'date_start' => ($product_special['date_start'] != '0000-00-00 00:00:00') ? $product_special['date_start'] : '',
'date_end' => ($product_special['date_end'] != '0000-00-00 00:00:00') ? $product_special['date_end'] : ''
);
}
admin/view/template/catalog/product_form.tpl
<tbody>
<?php $special_row = 0; ?>
<?php foreach ($product_specials as $product_special) { ?>
<tr id="special-row<?php echo $special_row; ?>">
<td class="text-left"><select name="product_special[<?php echo $special_row; ?>][customer_group_id]" class="form-control">
<?php foreach ($customer_groups as $customer_group) { ?>
<?php if ($customer_group['customer_group_id'] == $product_special['customer_group_id']) { ?>
<option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo
И т.д...
</tbody>
<tfoot>
Вместо него вставляем
<tbody>
<?php $special_row = 0; ?>
<?php foreach ($product_specials as $product_special) { ?>
<tr id="special-row<?php echo $special_row; ?>">
<td class="text-left"><select name="product_special[<?php echo $special_row; ?>][customer_group_id]" class="form-control">
<?php foreach ($customer_groups as $customer_group) { ?>
<?php if ($customer_group['customer_group_id'] == $product_special['customer_group_id']) { ?>
<option value="<?php echo $customer_group['customer_group_id']; ?>" selected="selected"><?php echo $customer_group['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $customer_group['customer_group_id']; ?>"><?php echo $customer_group['name']; ?></option>
<?php } ?>
<?php } ?>
</select></td>
<td class="text-right"><input type="text" name="product_special[<?php echo $special_row; ?>][priority]" value="<?php echo $product_special['priority']; ?>" placeholder="<?php echo $entry_priority; ?>" class="form-control" /></td>
<td class="text-right"><input type="text" name="product_special[<?php echo $special_row; ?>][price]" value="<?php echo $product_special['price']; ?>" placeholder="<?php echo $entry_price; ?>" class="form-control" /></td>
<td class="text-left" style="width: 20%;"><div class="input-group date">
<input type="text" name="product_special[<?php echo $special_row; ?>][date_start]" value="<?php echo $product_special['date_start']; ?>" placeholder="<?php echo $entry_date_start; ?>" data-date-format="YYYY-MM-DD HH:mm" class="form-control" />
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
</span></div></td>
<td class="text-left" style="width: 20%;"><div class="input-group date">
<input type="datetime" name="product_special[<?php echo $special_row; ?>][date_end]" value="<?php echo $product_special['date_end']; ?>" placeholder="<?php echo $entry_date_end; ?>" data-date-format="YYYY-MM-DD HH:mm" class="form-control" />
<span class="input-group-btn">
<button class="btn btn-default" type="button"><i class="fa fa-calendar"></i></button>
</span></div></td>
<td class="text-left"><button type="button" onclick="$('#special-row<?php echo $special_row; ?>').remove();" data-toggle="tooltip" title="<?php echo $button_remove; ?>" class="btn btn-danger"><i class="fa fa-minus-circle"></i></button></td>
</tr>
<?php $special_row++; ?>
<?php } ?>
</tbody>