Код: Выделить всё
ALTER TABLE `s_products` ADD `free_delivery` TINYINT( 0 ) NOT NULL AFTER `featured`;
UPDATE `s_products` SET `free_delivery` = 0;
Дальше идем в /backend/ProductAdmin.php ищем строку 19
Код: Выделить всё
$product->visible = $this->request->post('visible', 'boolean');
и ниже вставим
Код: Выделить всё
$product->free_delivery = $this->request->post('free_delivery', 'boolean');
Теперь добавим галочку в шаблоне backend/design/html/product.tpl после строк (486) ищем
Код: Выделить всё
<div class="checkbox">
<input name=featured value="1" type="checkbox" id="featured_checkbox" {if $product->featured}checked{/if}/>
<label class="featured_icon" for="featured_checkbox">Хит продаж</label>
</div>
и ниже вставим
Код: Выделить всё
<div class="checkbox">
<input name=free_delivery value="1" type="checkbox" id="free_delivery_checkbox" {if $product->free_delivery}checked{/if}/> <label for="free_delivery_checkbox">Беспл. Досавка</label>
</div>
в файле backend/design/html/products.tpl ищем (99строка)
Код: Выделить всё
{if $product->featured}featured{/if}
и заменим на
Код: Выделить всё
{if $product->featured}featured{/if} {if $product->free_delivery}free_delivery{/if}
ниже ищем (149)
Код: Выделить всё
<a class="featured" title="Хит продаж" href="#"></a>
ниже вставим
Код: Выделить всё
<a class="free_delivery" title="бесп.доставка" href="#">Б</a>
далее ищем строку 570
Код: Выделить всё
// Подтверждение удаления
и выше вставим
Код: Выделить всё
// Бесплатная доставка
$("a.free_delivery").click(function() {
var icon = $(this);
var line = icon.closest("div.row");
var id = line.find('input[type="checkbox"][name*="check"]').val();
var state = line.hasClass('free_delivery')?0:1;
icon.addClass('loading_icon');
$.ajax({
type: 'POST',
url: 'ajax/update_object.php',
data: {'object': 'product', 'id': id, 'values': {'free_delivery': state}, 'session_id': '{/literal}{$smarty.session.id}{literal}'},
success: function(data){
icon.removeClass('loading_icon');
if(state)
line.addClass('free_delivery');
else
line.removeClass('free_delivery');
},
dataType: 'json'
});
return false;
});
далее в main.css ищем (215)
Код: Выделить всё
.icons a.enable{
background-position: -4px -652px;
}
ниже вставим
Код: Выделить всё
.icons a.free_delivery{
background: none;
font-weight: bold;
color: #b9b9b9;
font-size: 20px;
}
.free_delivery .icons a.free_delivery{
background: none;
font-weight: bold;
color: #ffe200;
font-size: 20px;
}
далее в style.css строка 662 ищем
Код: Выделить всё
width:485px;
меняем на
Код: Выделить всё
width:458px;
далее в api/products.php ищем в двух местах (174,370строки)
Код: Выделить всё
p.visible,
вставляем в двух местах
Код: Выделить всё
p.free_delivery,
далее идем в yandex.php
ищем
Код: Выделить всё
v.compare_price,
ниже вставим
Код: Выделить всё
p.free_delivery AS product_free_delivery,
ниже ищем
Код: Выделить всё
$old_price = ($old_price > 0 ? "<oldprice>$old_price</oldprice>" : '');
и после этой строки вставим
Код: Выделить всё
$delivery = $okay->delivery->get_delivery(1);
if ($p->product_free_delivery == 1 || $p->price >= $delivery->free_from) {
$local_delivery_cost = '0';
}
else {
$local_delivery_cost = '600';}
далее ищем
Код: Выделить всё
print "</offer>";
и выше вставим
Код: Выделить всё
print "<local_delivery_cost>".$local_delivery_cost."</local_delivery_cost>";