# Default SSL certificate enabled website
server {
listen 443 default_server http2 ssl;
server_name _;
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log warn;
# Enable SSL connection
include bx/conf/magkvartir.ru_ssl.conf;
server_name_in_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:443;
proxy_set_header HTTPS YES;
set $proxyserver "127.0.0.1:8888";
set $docroot "/home/bitrix/www";
index index.php;
root /home/bitrix/www;
# Include parameters common to all websites
include bx/conf/bitrix.conf;
# Include server monitoring API's
include bx/server_monitor.conf;
}
; (function ($) {
$('#order-form').submit(function (e) {
var $form = new FormData();
var amounts = $('#registration-summa');
var fio = $('#registration-fio');
var phone = $('#registration-phone');
var email = $('#registration-email');
// if (amounts.val() == '' || $.isNumeric(amounts.val()) == false) {
// amounts.css('border-color', 'red'); amounts.attr('placeholder', 'Заполните поле!'); amounts.focus(); return false;
// }
// if (fio.val() == '') {
// fio.css('border-color', 'red'); fio.attr('placeholder', 'Заполните поле!'); fio.focus(); return false;
// }
// if (phone.val() == '') {
// phone.css('border-color', 'red'); phone.attr('placeholder', 'Заполните поле!'); phone.focus(); return false;
// }
// if (email.val() == '') {
// email.css('border-color', 'red'); email.attr('placeholder', 'Заполните поле!'); email.focus(); return false;
// }
var amountSber = amounts.val();
var DescrSber = fio.val() + ', ' + phone.val() + ', ' + email.val();
ipayCheckout({
amount: amountSber,
currency: 'RUB',
order_number: '',
description: DescrSber
},
function (order) {
showSuccessfulPurchase(order)
},
function (order) {
showFailurefulPurchase(order)
});
function showSuccessfulPurchase(order) {
$.ajax({
type: "POST", //Метод отправки
url: "/wp-content/themes/Paritet/sendmail_order.php", //путь до php фаила отправителя
data: $form,
success: function (e) {
console.log(e);
}
});
}
function showFailurefulPurchase(order) {
console.log('Ошибка');
}
//отмена действия по умолчанию для кнопки submit
e.preventDefault();
});
})(jQuery);