Commit c806f56b by Яков

test

parent c8fd5491
discount_phone:
class: sfDoctrineRouteCollection
options:
model: DiscountPhone
module: discount_phone
prefix_path: /discount_phone
column: id
with_wildcard_routes: true
discount:
class: sfDoctrineRouteCollection
options:
model: Discount
module: discount
prefix_path: /discount
column: id
with_wildcard_routes: true
notification_emails:
class: sfDoctrineRouteCollection
options:
......
<?php
if (!$form->isNew()) {
$discount = Doctrine::getTable('DiscountPhone')->findOneByOrderId($form->getObject()->getId());
$offers = $form->getObject()->getOffers();
if (count($offers) > 0) {
?>
<div class="advanced_custom">
<?php
if ($discount) {
?>
<div>Использована скидка <?php echo $discount->getDiscount()->getTitle() . ' с ' . $discount->getActiveDiscount() . '%' ?></div>
<?php
}
?>
<div class="advanced_custom__h">Товарные предложения<sup>&nbsp;<?php echo count($offers);?></sup></div>
<div class="content">
<table width="100%" cellspacing="0" cellpadding="0">
......@@ -17,7 +25,7 @@ if (!$form->isNew()) {
<?php
$total = 0;
foreach ($offers as $offer) {
echo '<tr align="right"><td align="left">' . $offer['Offer']['Translation']['ru']['title'] . '</td><td>' . $offer['amount'] . '</td><td>' . number_format($offer['Offer']['price'], 0, ',', ' ') . '&nbsp;₽</td><td><nobr>' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
echo '<tr align="right"><td align="left">' . $offer['Offer']['Translation']['ru']['title'] . '</td><td>' . $offer['amount'] . '</td><td>' . number_format($offer['price']/$offer['amount'], 0, ',', ' ') . '&nbsp;₽</td><td><nobr>' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
$total += $offer['price'];
}
echo '<tr class="advanced_custom__tr_divider_top"><td align="right" colspan="4"><nobr><b>Итого:&nbsp;</b>' . number_format($total, 0, ',', ' ') . '&nbsp;₽</nobr></td></tr>';
......
......@@ -21,6 +21,7 @@ all:
class: sfSessionStorage
param:
session_name: om
session_cookie_lifetime: 2592000
routing:
class: sfPatternRouting
param:
......
......@@ -8,6 +8,10 @@ homepage:
requirements:
sf_culture: (?:ru|en)
homepage_discount:
url: /:sf_culture/discount/:url/
param: { module: main, action: index }
search:
url: /:sf_culture/search/
param: { module: search, action: search }
......@@ -24,6 +28,10 @@ review:
url: /:sf_culture/review/
param: { module: review, action: index }
discount:
url: /:sf_culture/discount/
param: { module: discount, action: index }
catalog:
url: /:sf_culture/catalog/
param: { module: catalog, action: index }
......@@ -48,6 +56,10 @@ basket_complete:
url: /:sf_culture/basket/complete/
param: { module: basket, action: complete }
basket_check_discount:
url: /:sf_culture/basket/check_discount/
param: { module: discount, action: check_discount }
catalog_show_cat:
url: /catalog/:alias/
param: { module: catalog, action: show_cat }
......@@ -84,6 +96,10 @@ uploader:
url: /uploader/
param: { module: main, action: uploader }
check_discount_term:
url: /check_discount_term/
param: { module: discount, action: check_discount_term }
page_show:
url: /:sf_culture/:alias/
class: sfDoctrineRoute
......
......@@ -6,7 +6,7 @@ prod:
dev:
.settings:
error_reporting: <?php echo (E_ALL | E_STRICT)."\n" ?>
web_debug: false
web_debug: true
cache: true
etag: false
logging_enabled: false
......
......@@ -4,18 +4,18 @@ default:
metas:
robots: 'index, follow'
stylesheets:
- 'fonts.css?deploy=1519103100'
- 'g.css?deploy=1519103101'
- 'p.css?deploy=1519103104'
- 'a.css?deploy=1519103102'
- 'fonts.css?deploy=1519103092'
- 'g.css?deploy=1519103094'
- 'p.css?deploy=1519103095'
- 'a.css?deploy=1519103092'
- 'nouislider.css?deploy=1519103100'
javascripts:
- 'jquery-2.1.4.min.js?deploy=1519103100'
- 'jquery.plugins.js?deploy=1519103100'
- 'jquery.cycle2.min.js?deploy=1519103100'
- 'jquery.cycle2.swipe.js?deploy=1519103100'
- 'jquery.cycle2.carousel.min.js?deploy=1519103100'
- 'nouislider.js?deploy=1519103100'
- 'init.d.js?deploy=1519103100'
- 'jquery-2.1.4.min.js?deploy=1519103092'
- 'jquery.plugins.js?deploy=1519103092'
- 'jquery.cycle2.min.js?deploy=1519103092'
- 'jquery.cycle2.swipe.js?deploy=1519103092'
- 'jquery.cycle2.carousel.min.js'
- 'nouislider.js?deploy=1519103092'
- 'init.d.js?deploy=1519103092'
has_layout: true
layout: layout
......@@ -344,6 +344,30 @@ class basketActions extends sfActions
$this->order_form->bind($request->getParameter($this->order_form->getName()));
if($this->order_form->isValid()){
$params =$request->getParameter($this->order_form->getName());
$phone = $params['phone'];
if ($this->getUser()->hasAttribute('active_discount') && $this->getUser()->getAttribute('active_discount') != false) {
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $phone)
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')
AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($discount) > 0) {
$discount = intval($discount->getFirst()->getActiveDiscount());
} else {
$discount = 0;
}
} else {
$discount = 0;
}
$order = $this->order_form->save();
$basket->setBasketOrderId($order->getId());
$basket->save();
......@@ -364,22 +388,45 @@ class basketActions extends sfActions
$products['sum'] = 0;
foreach ($basket->getBasketOffer()->toArray() as $key => $basketOffer)
foreach ($basket->getBasketOffer() as $key => $basketOffer)
{
$offerTranslation = Doctrine_Query::create()
->select('o.*, t.*')
->from('Offer o')
->where('o.id = ?', intval($basketOffer['offer_id']))
->where('o.id = ?', intval($basketOffer->getOfferId()))
->leftJoin('o.Translation t')
->fetchArray();
if ($discount && $offerTranslation[0]['discount_available'] == 1) {
$basketOffer->setPrice($basketOffer->getPrice()/100*(100-$discount));
$basketOffer->save();
}
$products['elem'][$key]['name'] = $offerTranslation[0]['Translation']['ru']['title'];
$products['elem'][$key]['price'] = intval($basketOffer['price'])/$basketOffer['amount'];
$products['elem'][$key]['count'] = $basketOffer['amount'];
$products['sum'] = $products['sum'] + intval($basketOffer['price']);
$products['elem'][$key]['price'] = number_format(intval($basketOffer->getPrice())/$basketOffer->getAmount(), 0, ',', ' ');
$products['elem'][$key]['count'] = $basketOffer->getAmount();
$products['sum'] = $products['sum'] + intval($basketOffer->getPrice());
}
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$phone_discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $this->getUser()->getAttribute('phone_number'))
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\') AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($phone_discount) > 0) {
$phone_discount = $phone_discount->getFirst();
$phone_discount->setOrderId($order->getId());
$phone_discount->save();
}
$this->getUser()->setAttribute('active_discount', false);
$this->getUser()->setAttribute('phone', false);
$this->getUser()->setAttribute('number_of_views', false);
$emails_dirty = NotificationEmailsTable::getInstance()->createQuery('e')
->select('e.email')
......@@ -420,7 +467,6 @@ class basketActions extends sfActions
);
}
$this->redirect('@basket_complete');
}
}
......
......@@ -24,5 +24,8 @@ class basketComponents extends sfComponents
if(count($this->offers) > 0){
$this->info = $user->getBasketInfo();
}
if ($this->getUser()->hasAttribute('active_discount') && $this->getUser()->getAttribute('active_discount') != false) {
$this->percent = $this->getUser()->getAttribute('active_discount');
}
}
}
\ No newline at end of file
......@@ -13,12 +13,15 @@
</thead>
<tbody valign="middle">
<?php
if (!isset($percent)) {
$percent = false;
}
$summ = 0;
$productFreeShipping = 1;
foreach ($offers as $offer){
if ($offer['Product']['free_shipping'] == 0) {
$productFreeShipping = 0;
}
//print_r($offer);
$quantity_type = $offer['Translation'][$culture]['quantity_type'];
if ($offer['quantity_type_select']) {
$quantity_type = (isset(Offer::$quantity_type_select_values[$offer['quantity_type_select']]) ? Offer::$quantity_type_select_values[$offer['quantity_type_select']] : '');
......@@ -30,7 +33,7 @@
$offer_img = $offer_imgs[0];
}
//print_r($offer['Product']);
echo '<td valign="top"><a style="border: none" href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/"><div class="basket_img" ' . ($offer_img ? 'style="background-image: url(/u/i/' . Page::replaceImageSize($offer_img, 'S') . ');"' : '') . '></div></a>';
echo '<td valign="top"><a style="border: none" href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/"><div class="basket_img ' . ($offer['discount_available'] == 1 ? 'discount' : '') . '" ' . ($offer_img ? 'style="background-image: url(/u/i/' . Page::replaceImageSize($offer_img, 'S') . ');"' : '') . '></div></a>';
echo '<td><div class="basket_offer_title"><a href="/' . $offer['Translation'][$culture]['lang'] . '/product/' . $offer['Product']['alias'] . '/">' . $offer['Translation'][$culture]['title'] . '</a></div></td>';
echo '</td>';
echo '<td class="align_center"><div class="product_counter" data-id="' . $offer['id'] . '">';
......@@ -38,15 +41,22 @@
echo '<input autocomplete="off" type="text" class="product_counter_val" value="' . $offer['BasketOffer'][0]['amount'] . '" data-symbol="false" onkeyup="counterLite.update($(this))">';
echo '<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this))">';
echo '</div><span class="name_unit">' . ($quantity_type != '' ? $quantity_type : '') . '</span></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center">' . number_format($offer['BasketOffer'][0]['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></td>';
if ($percent && $offer['discount_available'] == 1) {
echo '<td valign="middle" class="basket_offers_table__price align_center"><div style="position: relative"><div class="basket_discount"><span style="text-decoration: line-through">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;</span><span style="font-size: 15px" class="rub">i</span></div><div class="basket_item">' . number_format($offer['price']/100*(100-$percent), 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></div></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center"><div class="basket_item"> ' . number_format($offer['BasketOffer'][0]['price']/100*(100-$percent), 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></td>';
$summ = $summ + $offer['BasketOffer'][0]['price']/100*(100-$percent);
}else {
echo '<td valign="middle" class="basket_offers_table__price align_center"><div class="basket_item">' . number_format($offer['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></td>';
echo '<td valign="middle" class="basket_offers_table__price align_center"><div class="basket_item">' . number_format($offer['BasketOffer'][0]['price'], 0, ',', ' ') . '&nbsp;<span class="rub">i</span></div></td>';
$summ = $summ + $offer['BasketOffer'][0]['price'];
}
echo '<td width="1" align="center"><div class="basket_clean" onclick="basket.delete(this);"></div></td>';
echo '</tr>';
}
?>
</tbody>
</table>
<div class="basket_total" data-delivery-info="<?php echo $productFreeShipping ?>"><?php echo __('Итого');?>:<div class="basket_total__price"><?php echo number_format($info['price'], 0, ',', ' ');?></div>&nbsp;<span class="rub">i</span></div>
<div class="basket_total" data-delivery-info="<?php echo $productFreeShipping ?>"><?php echo __('Итого');?>:<div class="basket_total__price"><?php echo number_format($summ, 0, ',', ' ');?></div>&nbsp;<span class="rub">i</span></div>
</div>
</div>
......
......@@ -42,7 +42,7 @@ echo '<h1 class="content_title">' . __('Корзина') . '</h1>';
<?php
echo '<h2>' . __('Контактные данные') . ':</h2>';
echo '<div class="basket_buyer__item"><input size="27" maxlength="255" required="1" placeholder="Как к вам обращаться" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="noempty" class="basket_buyer__inp_name validate_it" name="basket_order[username]" id="basket_order_username" type="text"></div>';
echo '<div class="basket_buyer__item"><input size="27" maxlength="24" required="1" placeholder="Номер телефона" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="phone" class="basket_buyer__inp_name validate_it" name="basket_order[phone]" id="basket_order_phone" type="text"></div>';
echo '<div class="basket_buyer__item"><div class="phone_info"></div><input size="27" maxlength="24" required="1" placeholder="Номер телефона" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="phone" class="basket_buyer__inp_name phone_mask validate_it" name="basket_order[phone]" id="basket_order_phone" type="text"></div>';
echo '<div class="basket_buyer__item"><input size="27" maxlength="24" required="1" placeholder="Email" onchange="form_validator.check($(this))" onkeyup="form_validator.check($(this))" data-check-rule="email" class="basket_buyer__inp_name validate_it" name="basket_order[email]" id="basket_order_email" type="text"></div>';
?>
</div>
......@@ -86,11 +86,126 @@ echo '<h1 class="content_title">' . __('Корзина') . '</h1>';
<?php
echo '<h2>' . __('Общая сумма заказа') . '</h2>';
echo '<div class="basket_order__price">' . $info['priceText'] . '&nbsp;<span class="rub">i</span></div>';
echo '<input type="submit" class="btn green_b_btn order_btn btn_disabled" value="' . __('Оформить заказ') . '" onclick="yaCounter48466937.reachGoal(\'ORDER\')" disabled>';
echo '<input type="submit" class="btn green_b_btn order_btn btn_disabled" value="' . __('Оформить заказ') . '" disabled>';
?>
</div>
<script type="text/javascript">
var lastvalue = '';
var lastvalueunmask = '';
function mask(str) {
var arr = str.split('');
if (str.length >= 2)
{
arr.splice(2,0," (");
if (str.length >= 5)
{
arr.splice(6,0,") ");
}
if (str.length >=8)
{
arr.splice(10,0,"-");
}
if (str.length >= 10)
{
arr.splice(13,0,"-");
}
}
return arr.join('');
}
function unmask(str) {
var rep = /[()\-\s]/g;
var value = str.replace(rep, '');
return value;
}
$('.phone_mask').on('input', function () {
var value = unmask($(this).val());
var last = value.slice(-1);
var first = value.charAt(0);
var rep = /(^\+7)(9)([0-9]{0,9})/g;
if ((value.length == 2) && (first == '+'))
{
if (value == '+9')
{
value = '+79';
lastvalue = '+79';
}else
{
value = '+7';
lastvalue = '+7';
}
}else
if ((value == '7') || (value == '8'))
{
value = '+7';
} else
if (value == '9')
{
value = '+79';
} else
{
var execval = rep.exec(value);
if (execval != null)
{
value = execval[0];
} else
{
if ((last != '9'))
{
value = value.substring(0, value.length - 1)
}
}
}
$(this).val(mask(value));
lastvalue = $(this).val();
lastvalueunmask = value;
});
$('.phone_mask').on('keydown', function (event) {
var key = event.keyCode || event.charCode;
if( key == 8 || key == 46 ){
var value = unmask($('.phone_mask').val());
value = value.substring(0, value.length - 1);
$('.phone_mask').val(mask(value));
lastvalue = $('.phone_mask').val();
return false;
}
});
$('.phone_mask').on('blur', function (e) {
if ($('.phone_mask').val().length == 18) {
$.ajax({
url: '/ru/basket/check_discount/',
dataType: 'json',
type: 'post',
data: {phone: $('.phone_mask').val()},
success: function (data) {
if (data.status == 'success' && data.active_discount > 0) {
$('.basket_refresh').html(data.body);
$($('.top_right')[1]).addClass('discount_basket');
$('.phone_info').html('На этом номере обнаружена скидка ' + data.active_discount + '%')
} else if (data.status == 'success' && data.active_discount == 0) {
$('.basket_refresh').html(data.body);
$($('.top_right')[1]).removeClass('discount_basket');
$('.phone_info').html('На этом номере скидка не обнаружена')
}
},
error: function (error) {
console.log(error);
}
})
}
})
$(document).ready(function () {
var delivery_info = $('.basket_total').data('delivery-info');
console.log(delivery_info);
......
......@@ -141,7 +141,7 @@ class catalogActions extends sfActions
->orderBy('p.sort asc');
//->andWhere("CHAR_LENGTH(p.product_img) > 0");
$products_q = Doctrine_Query::create()
->select("p.id, p.alias, p.product_img, p.is_detail, p.offer_count, p.is_delete, c.*, t.id, t.lang, t.title, o.id, o.product_id, o.price, o.quantity_type_select, ot.*, ppv.*")
->select("p.id, p.alias, p.product_img, p.is_detail, p.offer_count, p.is_delete, c.*, t.id, t.lang, t.title, o.id, o.product_id, o.price, o.quantity_type_select, o.discount_available, ot.*, ppv.*")
->from("Product p")
->leftJoin("p.CatProduct c")
->leftJoin("p.Translation t")
......
......@@ -86,7 +86,7 @@
<tr>
<td colspan="5">
<i class="br40"></i>
<a href="" class="btn green_btn calculator_table__btn" onclick="yaCounter48466937.reachGoal('ADD');">Добавить в корзину</a>
<a href="" class="btn green_btn calculator_table__btn">Добавить в корзину</a>
</td>
</tr>
</tbody>
......
......@@ -50,3 +50,11 @@ echo '<h1 class="content_title">' . $translation[$culture]['title'] . '</h1>';
}
?>
</div>
<script>
$('.discount_available').on('click', function (e) {
if ($(window).width() < 650) {
$(this).toggleClass('show');
}
})
</script>
......@@ -17,7 +17,6 @@ class mainActions extends sfActions
*/
public function executeIndex(sfWebRequest $request)
{
/**/
$this->setLayout('layoutHome');
$this->video = Doctrine_Query::create()
->select("v.*, t.*")
......@@ -62,6 +61,7 @@ class mainActions extends sfActions
->andWhere("c.is_main = 1")
->orderBy("RAND()")
->fetchOne();
}
public function executeDl(sfWebRequest $request)
{
......
<table class="lending" style="width: 100%" cellspacing="0" cellpadding="0">
<tr>
<td>
......
......@@ -56,5 +56,41 @@ class productActions extends sfActions
$this->setLayout('layoutPage');
if ($this->getUser()->hasAttribute('number_of_views') && $this->getUser()->getAttribute('number_of_views') != false) {
$number_of_view = $this->getUser()->getAttribute('number_of_views');
if ($this->getUser()->getAttribute('number_of_views') < 10) {
if (!$this->getUser()->hasAttribute('ids_view_product') || $this->getUser()->getAttribute('ids_view_product') == false) {
$this->getUser()->setAttribute('ids_view_product', $this->product['id'] . ';');
} else {
$str_ids = $this->getUser()->getAttribute('ids_view_product');
$ids = explode(';', $str_ids);
if (!in_array($this->product['id'], $ids)) {
$number_of_view++;
$this->getUser()->setAttribute('number_of_views', $number_of_view);
$this->getUser()->setAttribute('ids_view_product', $str_ids . $this->product['id'] . ';');
}
}
}
if ($number_of_view == 5 || $number_of_view == 7 || $number_of_view == 10) {
if ($this->getUser()->hasAttribute('phone_number') && $this->getUser()->getAttribute('phone_number') != false) {
$date_now = new DateTime('now');
$date_limit = new DateTime('now');
$date_limit->modify('-30 day');
$phone_discount = Doctrine_Query::create()
->select()
->from('DiscountPhone dp')
->where('dp.phone = ?', $this->getUser()->getAttribute('phone_number'))
->andWhere('dp.order_id is null')
->andWhere('dp.created_at BETWEEN STR_TO_DATE(\'' . $date_limit->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\') AND STR_TO_DATE(\'' . $date_now->format('Y-m-d H:i:s') . '\', \'%Y-%m-%d %H:%i:%s\')')
->execute();
if (count($phone_discount) > 0) {
$phone_discount = $phone_discount->getFirst();
$phone_discount->setActiveDiscount($number_of_view);
$phone_discount->save();
$this->getUser()->setAttribute('active_discount', $number_of_view);
}
}
}
}
}
}
......@@ -3,14 +3,24 @@ if (isset($product)) {
$translation = $product['Translation'];
$productImg = explode(';', $product['product_img']);
$productImg = (count($productImg) > 0 ? $productImg[0] : false);
echo '<div class="catalog_category_child_item">';
$q = Doctrine::getTable('Product')->findOneById($product['id'])->getOffer();
$discount_available = false;
foreach ($q as $offer) {
if ($offer->getDiscountAvailable() == 1) {
$discount_available = true;
break;
}
}
echo '<div class="catalog_category_child_item ' . ($discount_available ? 'discount' : '') . '">';
if ($discount_available) {
echo '<div class="discount_available"><div class="discount_available_desc">Ищите наши QR-коды в видео и соц. сетях и забирайте скидку</div><div class="discount_available_title">Доступен со скидкой</div></div>';
}
echo '<' . ($product['is_detail'] ? 'a' : 'span') . ' href="' . url_for("@product_show?alias=" . $product['alias']) . '" class="anb">';
if($productImg){
echo '<img src="/i/n.gif" style="background-image: url(/u/i/' . Page::replaceImageSize($productImg, 'S') . ');" />';
}else
{
$offerImg = '';
$q = Doctrine::getTable('Product')->findOneById($product['id'])->getOffer();
foreach ($q as $offer) {
if (strlen($offer->getImg()) > 3)
$offerImg = $offer->getImg();
......
......@@ -115,7 +115,7 @@ $view = 'much';
<input data-initialized="1" data-id="<?php echo $offer['id']; ?>" type="radio" name="offer" onchange="counterLite.change($(this))">
<?php if ($offer['price'] > 1) { ?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<tr <?php echo ($offer['discount_available'] == 1 ? 'class="discount' : '') ?>">
<td><?php echo $offer['title'] . $quantity_type; ?></td>
<td style="white-space: nowrap;" align="right">
<?php echo $offer_str; ?>
......@@ -125,7 +125,7 @@ $view = 'much';
<div class="product_counter min" data-id="<?php echo $offer['id']; ?>" data-price="<?php echo $offer['price'];?>">
<input type="button" class="product_counter_minus" data-symbol="-" onclick="counterLite.update($(this))">
<input autocomplete="off" type="text" class="product_counter_val" value="<?php echo ( $infoAmount ? $infoAmount : 0 ) ?>" data-symbol="-+" onkeyup="counterLite.update($(this))">
<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this)); yaCounter48466937.reachGoal('ADD');">
<input type="button" class="product_counter_plus" data-symbol="+" onclick="counterLite.update($(this))">
</div>
</td>
</tr>
......
......@@ -11,7 +11,7 @@
?>
<title><?php include_slot('title', sfConfig::get('app_www_title')); ?></title>
</head>
<body>
<body <?php echo ($sf_request->hasParameter('url') ? 'class="scroll_hidden overlay_discount_active"' : '')?>>
<script type="text/javascript">
var culture = '<?php echo $sf_user->getCulture();?>';
</script>
\ No newline at end of file
......@@ -14,4 +14,5 @@
</table>
<?php include(sfConfig::get('sf_app_template_dir') . '/bottom.php'); ?>
<?php include(sfConfig::get('sf_app_template_dir') . '/footer.php'); ?>
\ No newline at end of file
<?php include(sfConfig::get('sf_app_template_dir') . '/footer.php'); ?>
......@@ -5,6 +5,13 @@
?>
</div>
</div>
<?php
if ($sf_request->hasParameter('url')) {
echo '<div class="overlay_discount overlay_discount_active" onclick="discount.close();"><div class="overlay_discount__item" onclick="event.stopPropagation();">';
include_component('discount','form');
echo '</div></div>';
}
?>
<div id="panel"></div>
<div class="search_overlay" onclick="search.close();">
<div class="search_overlay__line" onclick="event.stopPropagation();">
......
......@@ -24,15 +24,15 @@
<?php
/*<div class="region"><a href="" class="green_link bbs_d">Уфа, Респ. Башкортостан</a></div>*/
if (csSettings::get('phone')) {
echo '<div class="header__phone">' . __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" onclick="yaCounter48466937.reachGoal(\'PHONE\');">' . csSettings::get('phone') . '</a></div>';
echo '<div class="header__phone">' . __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '">' . csSettings::get('phone') . '</a></div>';
}
if (csSettings::get('email')) {
echo '<div><nobr>' . __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '" onclick="yaCounter48466937.reachGoal(\'POST\'); return true;">' . csSettings::get('email') . '</a></div>';
echo '<div><nobr>' . __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '">' . csSettings::get('email') . '</a></div>';
}
?>
</td>
<td class="top_right">
<a href="" class="callback_open_link green_link bbs_d" onclick="callback.open();yaCounter48466937.reachGoal('CALL');return false;"><?php echo __('Заказать звонок');?></a>
<a href="" class="callback_open_link green_link bbs_d" onclick="callback.open();return false;"><?php echo __('Заказать звонок');?></a>
</td>
</tr>
</table>
......@@ -45,6 +45,9 @@
<table class="second_floor__table" style="width: 100%; height: 100%" cellpadding="0" cellspacing="0">
<tr>
<?php
if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_discount') != false) {
$active_discount = $sf_user->getAttribute('active_discount');
}
$module_action = $sf_request->getParameter('module') . '_' . $sf_request->getParameter('action');
echo '<td width="100' . ($module_action == 'basket_complete' ? '%' : '') . '" align="center">';
$logo = '<img width="100" height="51" src="/i/logo.svg" />';
......@@ -54,7 +57,7 @@
echo '<td class="top_menu">';
include_component('main', 'menu');
echo '</td>';
echo '<td class="top_right">';
echo '<td style="position: relative;" class="top_right ' . ($module_action == 'basket_index' ? (isset($active_discount) ? 'discount_basket' : '') : (isset($active_discount) ? 'discount d' . $active_discount : '') ) . '">';
if($module_action != 'search_search'){
echo '<div class="search_btn" onclick="search._show();"></div>';
}
......
<div class="header_mobile mobile">
<?php
if ($sf_user->hasAttribute('active_discount') && $sf_user->getAttribute('active_discount') != false) {
$discount = $sf_user->getAttribute('active_discount');
} else {
$discount = false;
}
?>
<div class="header_mobile mobile <?php echo ($discount ? 'discount d' . $discount : '' )?>">
<table cellspacing="0" cellpadding="0" width="100%">
<tbody align="left" valign="middle">
<tr>
<td colspan="2">
<?php echo csSettings::get('phone') ? '<a href="tel:'. csSettings::get('phone') .'" class="header_mobile__phone_link" onclick="yaCounter48466937.reachGoal(\'PHONE\');">'. csSettings::get('phone') .'</a>' : ''; ?>
<?php echo csSettings::get('phone') ? '<a href="tel:'. csSettings::get('phone') .'" class="header_mobile__phone_link">'. csSettings::get('phone') .'</a>' : ''; ?>
</td>
<td width="1" align="right">
......@@ -36,13 +43,13 @@
</ul>
<div class="burder__contacts">
<?php if (csSettings::get('phone')) {
echo __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" class="anb" onclick="yaCounter48466937.reachGoal(\'PHONE\');">' . csSettings::get('phone') . '</a><i class="br10"></i>';
echo __('Телефон') . ':&nbsp;<a href="tel:' . preg_replace('/[^+0-9]/', '', csSettings::get('phone')) . '" class="anb">' . csSettings::get('phone') . '</a><i class="br10"></i>';
}
if (csSettings::get('email')) {
echo __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '" onclick="yaCounter48466937.reachGoal(\'POST\');return true;">' . csSettings::get('email') . '</a>';
echo __('Эл. почта') . '</nobr>:&nbsp;<a href="mailto:' . csSettings::get('email') . '">' . csSettings::get('email') . '</a>';
} ?>
</div>
<a href="" class="btn white_b_btn burder__callback_link" onclick="callback.open();yaCounter48466937.reachGoal('CALL');return false;">Заказать звонок</a>
<a href="" class="btn white_b_btn burder__callback_link" onclick="callback.open();return false;">Заказать звонок</a>
</div>
......
......@@ -3,7 +3,7 @@ all:
arm_title: 'Иди в баню - АРМ'
seo_header_sepr: ' - '
email_order: 'ufaros@gmail.com'
email_from: 'noreply@idivbanu.ru'
email_from: 'noreply@stone-dev.atmadev.ru'
secret_key: '2R]btNuO%c/L!}}[v"tY!pWX2JZ{03;!'
default_culture: ru_RU
import_auth_user: bath
......
......@@ -2,6 +2,6 @@ all:
doctrine:
class: sfDoctrineDatabase
param:
dsn: 'mysql:host=127.0.0.1;dbname=idivbanu'
dsn: 'mysql:host=127.0.0.1;dbname=stone_dev'
username: root
password: h7!nIay6HUtu
......@@ -481,6 +481,9 @@ Offer:
sort:
type: integer
default: 0
discount_available:
type: boolean
default: false
relations:
Product:
onDelete: CASCADE
......@@ -543,6 +546,11 @@ BasketOrder:
type: boolean
notnull: true
default: false
relations:
DiscountPhone:
onDelete: SET NULL
local: id
foreign: order_id
BasketOffer:
columns:
......@@ -616,4 +624,48 @@ Callback:
default: false
offer_id:
type: text
notnull: false
\ No newline at end of file
notnull: false
Discount:
actAs:
Timestampable: ~
columns:
title:
type: string(255)
notnull: true
utm:
type: string(255)
notnull: true
comment:
type: string(1000)
notnull: false
url:
type: string(20)
DiscountPhone:
actAs:
Timestampable: ~
columns:
phone:
type: string(20)
notnull: true
discount_id:
type: integer
notnull: true
order_id:
type: string(255)
notnull: false
default: null
active_discount:
type: integer
notnull: true
default: 3
relations:
BasketOrder:
onDelete: SET NULL
local: order_id
foreign: id
Discount:
onDelete: CASCADE
local: discount_id
foreign: id
\ No newline at end of file
......@@ -6,7 +6,7 @@
host=192.168.2.7
port=22
user=root
dir=/www/stone-dev.atmadev.ru/
dir=/www/idivbanu.ru/
type=rsync
[stone]
host=192.168.2.7
......
......@@ -4,6 +4,21 @@
/.ramcache
/.ramcache/*
/config/databases.yml
/data/exchange
/symfony
/test
/upload
/log
/symfony
\ No newline at end of file
/.ramcache
/.idea
/.git
/config/databases.yml
/config/app.yml
/data
/apps/www/config/factories.yml
/apps/arm/config/factories.yml
/symfony
/web/index.php
/web/a.php
/web/u
/config/properties.ini
/config/rsync_exclude.txt
\ No newline at end of file
......@@ -21,6 +21,7 @@ abstract class BaseOfferFormFilter extends BaseFormFilterDoctrine
'is_delete' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
'is_wholesale' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
'sort' => new sfWidgetFormFilterInput(),
'discount_available' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
));
......@@ -34,6 +35,7 @@ abstract class BaseOfferFormFilter extends BaseFormFilterDoctrine
'is_delete' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'is_wholesale' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'sort' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
'discount_available' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
));
......@@ -64,6 +66,7 @@ abstract class BaseOfferFormFilter extends BaseFormFilterDoctrine
'is_delete' => 'Boolean',
'is_wholesale' => 'Boolean',
'sort' => 'Number',
'discount_available' => 'Boolean',
'created_at' => 'Date',
'updated_at' => 'Date',
);
......
<?php
/**
* OfferTranslation filter form base class.
* offerTranslation filter form base class.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
*/
abstract class BaseOfferTranslationFormFilter extends BaseFormFilterDoctrine
abstract class BaseofferTranslationFormFilter extends BaseFormFilterDoctrine
{
public function setup()
{
$this->setWidgets(array(
'title' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'quantity_type' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'title' => new sfWidgetFormFilterInput(),
));
$this->setValidators(array(
'title' => new sfValidatorPass(array('required' => false)),
'quantity_type' => new sfValidatorPass(array('required' => false)),
'title' => new sfValidatorPass(array('required' => false)),
));
$this->widgetSchema->setNameFormat('offer_translation_filters[%s]');
......@@ -33,16 +31,15 @@ abstract class BaseOfferTranslationFormFilter extends BaseFormFilterDoctrine
public function getModelName()
{
return 'OfferTranslation';
return 'offerTranslation';
}
public function getFields()
{
return array(
'id' => 'Number',
'title' => 'Text',
'quantity_type' => 'Text',
'lang' => 'Text',
'id' => 'Number',
'title' => 'Text',
'lang' => 'Text',
);
}
}
<?php
/**
* OfferTranslation filter form.
* offerTranslation filter form.
*
* @package sf
* @subpackage filter
* @author Atma
* @version SVN: $Id: sfDoctrineFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class OfferTranslationFormFilter extends BaseOfferTranslationFormFilter
class offerTranslationFormFilter extends BaseofferTranslationFormFilter
{
public function configure()
{
......
......@@ -13,7 +13,7 @@ class OfferForm extends BaseOfferForm
public function configure()
{
$this->embedI18n(array('ru', 'en'));
$this->useFields(array('ru', 'en', 'quantity_type_select', 'price', 'sort', 'is_wholesale', 'img', 'product_id'));
$this->useFields(array('ru', 'en', 'quantity_type_select', 'price', 'sort', 'discount_available', 'img', 'product_id'));
$parentId = sfContext::getInstance()->getRequest()->getParameter('parentId');
if($parentId){
......@@ -22,7 +22,7 @@ class OfferForm extends BaseOfferForm
$this->setDefault('product_id', $parentId);
}
}
$this->widgetSchema['is_wholesale'] = new sfWidgetFormInputCheckbox(array('label' => 'Чужой товар'), array("required" => true));
$this->widgetSchema['discount_available'] = new sfWidgetFormInputCheckbox(array('label' => 'Доступен со скидкой?'), array("required" => true));
$this->widgetSchema['product_id'] = new sfWidgetFormInputHidden();
$this->widgetSchema['ru']['title'] = new sfWidgetFormInputText(array("label" => "Название"), array("size" => 64, "maxlength" => 255, "required" => true));
$this->widgetSchema['en']['title'] = new sfWidgetFormInputText(array("label" => "Название"), array("size" => 64, "maxlength" => 255, "required" => true));
......
......@@ -24,6 +24,7 @@ abstract class BaseOfferForm extends BaseFormDoctrine
'is_delete' => new sfWidgetFormInputCheckbox(array(), array("required" => true)),
'is_wholesale' => new sfWidgetFormInputCheckbox(array(), array("required" => true)),
'sort' => new sfWidgetFormInputText(array(), array("size" => 8, "maxlength" => 8)),
'discount_available' => new sfWidgetFormInputCheckbox(array(), array()),
'created_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
'updated_at' => new sfWidgetFormDateTime(array(), array("required" => true)),
));
......@@ -38,6 +39,7 @@ abstract class BaseOfferForm extends BaseFormDoctrine
'is_delete' => new sfValidatorBoolean(array('required' => false)),
'is_wholesale' => new sfValidatorBoolean(array('required' => false)),
'sort' => new sfValidatorInteger(array('required' => false)),
'discount_available' => new sfValidatorBoolean(array('required' => false)),
'created_at' => new sfValidatorDateTime(),
'updated_at' => new sfValidatorDateTime(),
));
......
......@@ -22,9 +22,6 @@ class wwwBasketOrderForm extends BaseBasketOrderForm
$this->validatorSchema['delivery_type'] = new sfValidatorChoice(array('choices' => array(0 => 'Самовывоз', 1 => 'Доставка по адресу'), 'required' => true));
$this->validatorSchema['phone'] = new sfValidatorAnd(array(
new sfValidatorNumber(array('required' => true)),
new sfValidatorString(array('max_length' => 24, 'required' => true))
));
$this->validatorSchema['phone'] = new sfValidatorString(array('max_length' => 24, 'required' => true));
}
}
......@@ -17,6 +17,7 @@
* @property boolean $is_confirm_admin
* @property boolean $is_payed
* @property boolean $is_given
* @property DiscountPhone $DiscountPhone
* @property Doctrine_Collection $Basket
*
* @method string getUsername() Returns the current record's "username" value
......@@ -31,6 +32,7 @@
* @method boolean getIsConfirmAdmin() Returns the current record's "is_confirm_admin" value
* @method boolean getIsPayed() Returns the current record's "is_payed" value
* @method boolean getIsGiven() Returns the current record's "is_given" value
* @method DiscountPhone getDiscountPhone() Returns the current record's "DiscountPhone" value
* @method Doctrine_Collection getBasket() Returns the current record's "Basket" collection
* @method BasketOrder setUsername() Sets the current record's "username" value
* @method BasketOrder setPhone() Sets the current record's "phone" value
......@@ -44,6 +46,7 @@
* @method BasketOrder setIsConfirmAdmin() Sets the current record's "is_confirm_admin" value
* @method BasketOrder setIsPayed() Sets the current record's "is_payed" value
* @method BasketOrder setIsGiven() Sets the current record's "is_given" value
* @method BasketOrder setDiscountPhone() Sets the current record's "DiscountPhone" value
* @method BasketOrder setBasket() Sets the current record's "Basket" collection
*
* @package sf
......@@ -126,6 +129,11 @@ abstract class BaseBasketOrder extends sfDoctrineRecord
public function setUp()
{
parent::setUp();
$this->hasOne('DiscountPhone', array(
'local' => 'id',
'foreign' => 'order_id',
'onDelete' => 'SET NULL'));
$this->hasMany('Basket', array(
'local' => 'id',
'foreign' => 'basket_order_id'));
......
......@@ -15,6 +15,7 @@
* @property boolean $is_delete
* @property boolean $is_wholesale
* @property integer $sort
* @property boolean $discount_available
* @property Product $Product
* @property Doctrine_Collection $BasketOffer
*
......@@ -28,6 +29,7 @@
* @method boolean getIsDelete() Returns the current record's "is_delete" value
* @method boolean getIsWholesale() Returns the current record's "is_wholesale" value
* @method integer getSort() Returns the current record's "sort" value
* @method boolean getDiscountAvailable() Returns the current record's "discount_available" value
* @method Product getProduct() Returns the current record's "Product" value
* @method Doctrine_Collection getBasketOffer() Returns the current record's "BasketOffer" collection
* @method Offer setInnerId() Sets the current record's "inner_id" value
......@@ -40,6 +42,7 @@
* @method Offer setIsDelete() Sets the current record's "is_delete" value
* @method Offer setIsWholesale() Sets the current record's "is_wholesale" value
* @method Offer setSort() Sets the current record's "sort" value
* @method Offer setDiscountAvailable() Sets the current record's "discount_available" value
* @method Offer setProduct() Sets the current record's "Product" value
* @method Offer setBasketOffer() Sets the current record's "BasketOffer" collection
*
......@@ -100,6 +103,10 @@ abstract class BaseOffer extends sfDoctrineRecord
'type' => 'integer',
'default' => 0,
));
$this->hasColumn('discount_available', 'boolean', null, array(
'type' => 'boolean',
'default' => false,
));
}
public function setUp()
......
......@@ -222,16 +222,19 @@ class exchangeDeleteimageTask extends sfBaseTask
}
$error = array();
$countDel = 0;
foreach ($allImageInDir as $item) {
if (file_exists($item)) {
chmod($item, 0777);
unlink($item);
$countDel++;
}else {
$error[] = 'file not found:' . $item;
if (count($allImageInDir) > 0 ) {
foreach ($allImageInDir as $item) {
if (file_exists($item)) {
chmod($item, 0777);
unlink($item);
$countDel++;
}else {
$error[] = 'file not found:' . $item;
}
}
}
print_r($allImageInDir);
$this->log('Count delete image: ' . $countDel);
$this->log('Image delete done: [' . round((microtime(true) - $time_start) * 1000) . ' ms]');
......
<?php
require_once(dirname(__FILE__).'/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('arm', 'prod', false);
$configuration = ProjectConfiguration::getApplicationConfiguration('arm', 'dev', true);
sfContext::createInstance($configuration)->dispatch();
......@@ -399,6 +399,41 @@
font-family: 'robotoregular';
}
.product_offer table tr.discount::after {
content: '';
position: absolute;
width: 10px;
height: 10px;
left: -5px;
top: 5px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(/i/percent_colored.svg);
}
.header_mobile.mobile.discount::after {
content: '';
width: 61px;
height: 137px;
position: absolute;
background-repeat: no-repeat;
background-size: contain;
right: 6px;
top: 96px;
z-index: -1;
}
.header_mobile.mobile.discount.d3::after {
background-image: url(/i/d3.svg);
}
.header_mobile.mobile.discount.d5::after {
background-image: url(/i/d5.svg);
}
.header_mobile.mobile.discount.d7::after {
background-image: url(/i/d7.svg);
}
.header_mobile.mobile.discount.d10::after {
background-image: url(/i/d10.svg);
}
.product__advantages__info__link {
font-size: 20px;
}
......@@ -443,7 +478,7 @@
height: auto;
}
.video {
height: 62vw;
height: 62vw !important;
}
.article_wrap {
......@@ -674,6 +709,7 @@
}
.footer_table_main {
padding: 20px 0 20px;
border-top: 1px solid #ececec;
}
.footer_table_main__policy {
font-style: normal;
......@@ -731,8 +767,62 @@
max-height: 10000px;
}
.overlay_discount__item {
height: 100%;
max-height: 510px;
}
.image_discount {
display: none;
}
.form_discount {
width: 100%;
max-height: 510px;
height: 100%;
}
.discount_available {
left: 13px !important;
}
.discount_available.show .discount_available_desc{
max-height: 100px;
padding: 5px 5px;
width: 100%;
}
.discount_available.show .discount_available_title {
border-radius: 0 0 4px 4px;
}
.discount_available.show:before {
background-image: url(/i/white_angle.svg);
transition: all 0s ease-in-out;
}
.basket_refresh {
position: relative;
overflow: visible;
z-index: 1;
}
.discount_form__title {
font-size: 21px;
}
}
@media (min-width: 650px){
.catalog_category_child_item:hover .discount_available_desc{
max-height: 100px;
padding: 5px 5px;
width: 100%;
}
.catalog_category_child_item:hover .discount_available_title {
border-radius: 0 0 4px 4px;
}
.catalog_category_child_item:hover .discount_available:before {
background-image: url(/i/white_angle.svg);
transition: all 0s ease-in-out;
}
}
@media (min-width: 1100px) and (max-width: 1200px) {
.top_menu__elem{
......
......@@ -230,22 +230,56 @@
margin-bottom: 5px;
margin-top: 8px;
}
.basket_btn::before {
content: '';
background-image: url(/i/basket.svg);
width: 23px;
height: 25px;
display: inline-block;
.basket_btn::before {
content: '';
background-image: url(/i/basket.svg);
width: 23px;
height: 25px;
display: inline-block;
position: absolute;
top: 50%;
left: 20px;
margin-top: -12px;
background-size: cover;
background-position: 100% 0;
transition: background-image 0.1s ease-in-out;
}
.basket_btn:not(.basket_btn_disabled):hover::before {
background-image: url(/i/basket-green.svg);
}
.top_right.discount::after {
width: 65px;
height: 148px;
background-size: contain;
background-repeat: no-repeat;
content: "";
position: absolute;
top: 50%;
left: 20px;
margin-top: -12px;
background-size: cover;
background-position: 100% 0;
transition: background-image 0.1s ease-in-out;
top: 75px;
right: 0;
z-index: -1;
}
.basket_btn:not(.basket_btn_disabled):hover::before {
background-image: url(/i/basket-green.svg);
.top_right.discount.d3::after {
background-image: url(/i/d3.svg);
}
.top_right.discount.d5::after {
background-image: url(/i/d5.svg);
}
.top_right.discount.d7::after {
background-image: url(/i/d7.svg);
}
.top_right.discount.d10::after {
background-image: url(/i/d10.svg);
}
.top_right.discount_basket::after {
content: '';
width: 30px;
height: 30px;
background-size: contain;
background-repeat: no-repeat;
position: absolute;
top: 5px;
right: -10px;
background-image: url(/i/percent_white.svg);
}
.swicher_lang {
background-image: url(/i/switch-lang.svg);
......@@ -567,7 +601,18 @@
color: var(--green-color-text);
}
.product_offer table td {
padding: 12px 10px 11px;
padding: 12px 0 11px 10px;
}
.product_offer table tr.discount::after {
content: '';
position: absolute;
width: 16px;
height: 16px;
left: -20px;
top: 5px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(/i/percent_colored.svg);
}
.product_offer table td:first-child {
padding-left: 0;
......@@ -728,6 +773,58 @@
display: inline-block;
margin: 0 8px 30px;
}
.catalog_category_child_item.discount {
}
.catalog_category_child_item .discount_available {
position: absolute;
color: #FFFFFF;
width: 150px;
left: 21px;
top: -5px;
z-index: 100;
}
.discount_available .discount_available_desc {
background-color: #FFFFFF;
color: #6a6a6a;
overflow: hidden;
max-height: 0px;
font-family: 'robotolight';
font-size: 12px;
padding: 0 5px;
box-shadow: 0 0 14px rgba(0,0,0,0.2);
transition: all 0.3s ease-in-out;
}
.discount_available .discount_available_title {
background-color: #fb8100;
color: #FFFFFF;
width: 150px;
border-radius: 0 4px 4px 4px;
padding: 7px 7px 7px 10px;
z-index: 100;
text-transform: uppercase;
font-family: 'robotobold';
font-size: 11px;
}
.catalog_category_child_item .discount_available::before {
content: '';
width: 14px;
height: 6px;
position: absolute;
background-size: contain;
background-repeat: no-repeat;
background-image: url(/i/orange_angle.svg);
left: -12px;
top: 0;
transition: all 0.48s ease-in-out;
}
.lending_product_area .catalog_category_child_item:nth-child(n+9) {
display: none;
}
......@@ -913,6 +1010,7 @@
background-image: url(/i/combined-shape-minus.svg);
outline: none;
padding: 0;
border-radius: 0;
}
.product_counter_val {
width: 45px;
......@@ -933,6 +1031,7 @@
height: 29px;
vertical-align: top;
float: left;
border-radius: 0px !important;
}
.product_counter_plus {
width: 23px;
......@@ -963,6 +1062,7 @@
background-image: url(/i/combined-shape-plus.svg);
outline: none;
padding: 0;
border-radius: 0;
}
.product_price_trigger {
padding: 0;
......@@ -1725,6 +1825,18 @@ label.custom_checkbox input:checked + .after_checkbox {
background-position: center;
border: 1px solid #ececec;
}
.basket_img.discount::after {
content: '';
position: absolute;
width: 30px;
height: 30px;
top: -10px;
right: -10px;
background-image: url(/i/percent_colored.svg);
background-repeat: no-repeat;
background-size: contain;
z-index: 100;
}
.basket_img__item{
width:100%;
height:100%;
......@@ -1835,7 +1947,8 @@ label.custom_checkbox input:checked + .after_checkbox {
.basket_get{
margin-bottom: 40px;
}
.basket_buyer__item{
.basket_buyer__item {
position: relative;
display: inline-block;
vertical-align: top;
}
......@@ -2160,7 +2273,6 @@ h2{
display: inline-block;
text-align: center;
vertical-align: middle;
width: calc(100% - 5px);
}
.review_file_overlay__item{
padding:20px;
......@@ -2240,11 +2352,13 @@ h2{
.search_active .search_overlay{
display: block;
}
.search_active .body_wrapper{
.search_active .body_wrapper,
.overlay_discount_active .body_wrapper {
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
filter: blur(10px);
opacity: 0.4;
transition: all 0.3s ease-in-out;
}
.search_overlay__line__btn{
margin-bottom: 0;
......@@ -2687,4 +2801,160 @@ h2{
.fotorama__stage__frame {
border: 1px solid #ececec !important;
}
.discount_form__checkbox {
max-width: 325px
}
.discount_form__checkbox label {
text-align: left;
}
.discount_form{
background: #fff;
margin: 0 auto;
border-radius: 0 2px 2px 0;
width: 100%;
max-width:400px;
margin: 0;
}
.discount_form input[type="text"]{
width:100%;
}
.discount_form__inp_wrap{
margin-bottom: 25px;
text-align:left;
}
.discount_form_done__title,
.discount_form_done .discount_form__process{
display:none;
}
.discount_form_done .discount_form_done__title{
display:block;
font-size: 20px;
color: var(--green-color-text);
font-family: 'robotolight';
}
.discount_form_done__title__base{
font-size:30px;
}
.discount_form__title{
font-size: 31px;
padding-bottom: 15px;
color: var(--green-color-text);
font-family: 'robotoregular';
}
.discount_form_head_text {
font-size: 18px;
font-family: 'robotoregular';
color: var(--green-color-text);
text-align: left;
padding: 25px 0 5px 0;
}
.discount_form_text {
font-size: 15px;
font-family: 'robotoregular';
text-align: left;
padding-bottom: 20px;
}
.discount_form__submit{
font-size: 15px;
font-size: 15px;
padding: 9px 23px;
cursor: pointer;
width: 100%;
}
.overlay_discount_active{
position: fixed;
background-image: url(/i/drops.png);
background-repeat: repeat;
background-size: cover;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1001;
text-align: center;
vertical-align: middle;
overflow-y: scroll;
}
.review_file_overlay{
z-index: 1001;
}
.overlay_discount{
display:none;
z-index:1002;
}
.overlay_discount_active {
display:block;
}
.video_overlay__close:hover{
opacity: 1;
}
.overlay_discount:after{
content: '';
display: inline-block;
height: 100%;
width: 0;
vertical-align: middle;
}
.overlay_discount__item{
display: inline-block;
text-align: center;
vertical-align: middle;
box-shadow: 0 0 35px rgba(0,0,0,0.3);
max-height: 400px;
}
.discount_error {
background-color: #FFFFFF;
padding: 35px 35px;
margin: 0 auto;
border-radius: 2px;
display: inline-block;
max-width: 400px;
width: 100%;
}
.image_discount {
width: 350px;
height: 400px;
background-repeat: no-repeat;
background-size: contain;
background-image: url(/i/discount-image.png);
display: inline-block;
border-radius: 2px 0 0 2px;
vertical-align: top;
}
.form_discount {
padding: 35px 40px;
width: 490px;
height: 100%;
vertical-align: top;
display: inline-block;
background-color: #FFFFFF;
border-radius: 0 2px 2px 0;
vertical-align: top;
max-height: 400px;
}
.phone_info {
position: absolute;
display: inherit;
margin-bottom: 10px;
font-size: 11px;
font-family: 'robotolight', Arial;
font-style: italic;
top: -17px;
left: 0;
}
.basket_discount {
display: block;
color: #979797;
font-size: 15px !important;
text-align: right;
position: absolute;
top: -15px;
right: 0;
}
.basket_item {
display: block;
text-align: right;
color: #074611;
}
\ No newline at end of file
<?php
require_once(dirname(__FILE__) . '/../config/ProjectConfiguration.class.php');
$configuration = ProjectConfiguration::getApplicationConfiguration('www', 'prod', true);
$configuration = ProjectConfiguration::getApplicationConfiguration('www', 'dev', true);
sfContext::createInstance($configuration)->dispatch();
......@@ -2663,6 +2663,47 @@ var imgUpload = {
}
};
var discount = {
submit: function(form){
form = $(form);
$.post(form.attr('action'), form.serialize(), function (html) {
$('.overlay_discount__item').html(html);
if ($(window).width() < 650) {
$('.header_mobile').addClass('discount');
$('.header_mobile').addClass('d3');
} else {
$($('.top_right')[1]).addClass('discount');
$($('.top_right')[1]).addClass('d3');
}
});
},
open:function (_this) {
if (_this)
{
$('#discount_offer').show();
$('#discount').hide();
offer_id = $(_this).attr('data-offer-id');
$('#discount_offer_id').val(offer_id);
}else
{
$('#discount').show();
$('#discount_offer').hide();
$('#discount_offer_id').val('');
}
var discountForm = $('.discount_form');
discountForm.removeClass('discount_form_done');
$('.overlay_discount').addClass('overlay_discount_active');
$('body').addClass('scroll_hidden');
$('body').addClass('overlay_discount_active');
discountForm.find('input[type="text"]').eq(0).focus();
},
close: function(){
$('.overlay_discount').removeClass('overlay_discount_active');
$('body').removeClass('scroll_hidden');
$('body').removeClass('overlay_discount_active');
}
};
var callback = {
submit: function(form){
form = $(form);
......@@ -2808,9 +2849,24 @@ var form_validator = {
function setUrlHash(hash) {
if ('replaceState' in window.history && window.location.hash !== hash) window.history.replaceState('', '', hash);
}
$(document).ready(function () {
//slider.init();
if ($('.phone_mask').length > 0) {
$('.phone_mask').mask("+7 (999) 999-9999");
}
$.ajax({
url: '/check_discount_term/',
dataType: 'json',
type: 'post',
success: function (data) {
if (data.status == 'success' && data.active_discount != 0) {
console.log('123');
if ($(window).width() < 650) {
$('.header_mobile').addClass('discount');
$('.header_mobile').addClass('d' + data.active_discount);
} else {
$($('.top_right')[1]).addClass('discount');
$($('.top_right')[1]).addClass('d' + data.active_discount);
}
}
}
})
});
User-agent: *
Allow: /i/
Disallow: /js/
Disallow: /css/
Disallow: /a/
User-agent: Googlebot
Allow: /
User-agent: Yandex
Allow: /i/
Disallow: /js/
Disallow: /css/
Disallow: /a/
Host: idivbanu.ru
Sitemap: http://idivbanu.ru/sitemap.xml
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment