Jump to content

Recommended Posts

Смысл вот в чем. Есть поставщики у которых на разные категории товаров (под одним брендом/производителем) разные скидки. Т.е. когда я хочу сделать акционную цену я через их прайс лист составляю каталог с полем артикул (по которому будет обновляться цена) и поле special с конкретной акционной ценой. И обновляю это все через CSV Price Pro import/export. Но в стандартном варианте я не могу выставить время включения и отключения акции. К примеру мне нужно что бы заданные цены по будням включались в будни в 18:00 а выключались в 06:00, а в выходные работали на полный день. Нашел идеально подходящее решение добавить время к дате в поле акции. Но проблема в то что время добавляется но не сохраняется поле нажатия кнопки сохранить.

 

 

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
Share on other sites

Может надо еще в какие то файлы внести изменения?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.