ps -auxman pspwdx PIDlsof -p PID | grep cwdfunction declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}const note = $('#note');
$('#countdown').countdown({
timestamp: new Date(2017, 8, 15, 15, 20),
callback: function(days, hours, minutes, seconds){
let message = "";
let daysText, hoursText, minutesText, secondsText = "";
daysText = declOfNum(days, ['день', 'дня', 'дней']);
hoursText = declOfNum(hours, ['час', 'часа', 'часов']);
minutesText = declOfNum(minutes, ['минута', 'минуты', 'минут']);
secondsText = declOfNum(seconds, ['секунда', 'секунды', 'секунд']);
message += '<span class="timer__pointer">' + daysText +"</span>";
message += '<span class="timer__pointer">' + hoursText + "</span>";
message += '<span class="timer__pointer">' + minutesText + "</span>";
message += '<span class="timer__pointer timer__pointer--orange">' + secondsText + "</span>";
note.html(message);
}
});
var date1 = new Date();
var date2 = new Date('30.10.2015 19:53');
$data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);Добавить после:$data['discount_amount'] = $this->currency->format($this->tax->calculate(($product_info['price'] - $product_info['special']), $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);<li>
<h2><?php echo $special; ?></h2>
</li>Добавить после:<li class="discount_amount">
<?php echo 'Вы экономите '.$discount_amount; ?>
</li>$special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);Добавить после:$discount_amount = $this->currency->format($this->tax->calculate(($result['price'] - $result['special']), $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);Найти:'price' => $price,
'special' => $special,Добавить после:'discount_amount' => $discount_amount,<span class="price-new"><?php echo $product['special']; ?></span> <span class="price-old"><?php echo $product['price']; ?></span>Добавить после:<span class="discount_amount"><?php echo 'Вы экономите '.$product['discount_amount']; ?></span>return 301 https://$server_name$request_uri;location / {
try_files $uri $uri/ /index.php?$args;
}location / {
...
location / {
try_files $uri $uri/ /index.php?$args;
}
...
}server {
# Слушаем 80й порт
listen 80;
# Обслуживаем доменное имя, www тут же слушать не надо - будут дубликаты контента, печаль для SEO
server_name example.com;
# Корневая директория проекта
root /var/www/example.com/httpdocs;
# Индексы
index index.php index.html;
# Обработка запросов
# $uri - существует ли конкретный файл
# $uri/ - существует ли директория
# /index.php?$args - если это не запрос на существующий файл или директорию, то перебрасываем на роутер WordPress (это и есть то, что надо для пермалинков)
location / {
try_files $uri $uri/ /index.php?$args;
}
# Обрабатываем PHP
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
fastcgi_pass unix:/var/run/php5-fpm.sock; # или php7.0-fpm.sock
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
# Все остальное
# Запрещаем доступ к .htaccess
location ~ /\.ht {
deny all;
}
# Просим кешировать статику на Х дней, не писать в логи
location ~*
^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
log_not_found off;
expires 30d;
}
}
# Отдельно слушаем домен с www и редиректим на основной
server {
# Слушаем 80й порт
listen 80;
# Обслуживаем доменное имя c www
server_name www.example.com;
# Отправляем запрос на основной домен
return 301 $scheme://example.com$request_uri;
}Кто что посоветует?
<ul class="products">
<?php
$product_ids_on_sale = wc_get_product_ids_on_sale();
$args = array(
'post_type' => 'product',
'post__in' => array_merge( array( 0 ), $product_ids_on_sale )
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) {
while ( $loop->have_posts() ) : $loop->the_post();
wc_get_template_part( 'content', 'product' );
endwhile;
} else {
echo __( 'Продуктов не найдено' );
}
wp_reset_postdata();
?>
</ul><!--/.products-->