if (typeof wc_checkout_params !== 'undefined' ) {
var woo_checkout = wc_checkout_params;
}else if (typeof wc_cart_params !== 'undefined' ){
var woo_checkout = wc_cart_params;
}else {
return false;
}
var data = {
action: 'woocommerce_update_order_review',
security: woo_checkout.update_order_review_nonce,
post_data: $('form.checkout').serialize()
};
//console.log(data);
var xhr = $.ajax({
type: 'POST',
url: woo_checkout.ajax_url,
data: data,
success: function(response) {
console.log(response);
jQuery( 'form.checkout' ).trigger( 'update' );
},
error: function(code){
console.log('ERROR');
}
});
}
function update_order_shipping(yd_params){
var data = {
action: 'woocommerce_update_order_review',
security: wc_checkout_params.update_order_review_nonce,
delivery: yd_params,
post_data: $('form.checkout').serialize()
};
var xhr = $.ajax({
type: 'POST',
url: wc_checkout_params.ajax_url,
data: data,
success: function(response) {
console.log(response);
$('body').trigger('update_checkout');
},
error: function(code){
console.log('ERROR');
}
});
}
$(document).on('change','#shipping_method input[type="radio"]',function(){
console.log('update_checkout');
update_order_shipping('CDEK 100rub');
});add_action( 'woocommerce_update_order_review', 'yandex_delivery_add' );
function yandex_delivery_add(){
var_dump($_REQUEST["post_data"]);
}
name='shop_delivery_method[]' value='{"yd_id":"1495","yd_unique_name":"Boxberry","yd_name":"\u0411\u043e\u043a\u0441\u0431\u0435\u0440\u0440\u0438","yd_cost":"299"}'
############################################################################
#### Перенаправляем протокол http на https ####
############################################################################
RewriteCond %{HTTPS} off
# Проверяем наличие https в URL.
RewriteCond %{REQUEST_URI} !^/bitrix/admin/1c_exchange\.php$ [NC]
# Исключим обмен с 1С, ему требуется только 200
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Перенаправляем протокол на http.
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_php7.c>
php_flag session.use_trans_sid off
#php_flag default_charset UTF-8
#php_value display_errors 1
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# 301 редирект на https
RewriteCond %{HTTPS} !=on
# Исключение обмер с 1С по протоколу http
RewriteCond %{REQUEST_URI} !^/bitrix/admin/1c_exchange\.php$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteCond %{REQUEST_URI} ^(.*)/index\.(php|html|htm)$
# URL cодержит index.php в конце.
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.
#Правило обрабатывает внутренние страницы
# http://site.ru/catalog////item///
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
#Проверяем, повторяется ли слеш (//) более двух раз.
RewriteRule . %1/%2 [R=301,L]
#Исключаем все лишние слеши.
#удаляем слеши для главной http://site.ru/////
RewriteCond %{THE_REQUEST} ([^\s]*)\/{2,}(\?[^\s]*)?
RewriteRule (.*) / [R=301,L]
# ASPRO_ROBOTS Serve robots.txt with robots.php only if the latter exists
# RewriteCond %{REQUEST_FILENAME} robots.txt
# RewriteCond %{DOCUMENT_ROOT}/robots.php -f
# RewriteRule ^(.*)$ /robots.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# 301 редирект на https
RewriteCond %{HTTPS} !=on
# Исключение обмер с 1С по протоколу http
RewriteCond %{REQUEST_URI} !^/bitrix/admin/1c_exchange\.php$ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteCond %{REQUEST_URI} ^(.*)/index\.(php|html|htm)$
# URL cодержит index.php в конце.
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.
RewriteCond %{REQUEST_METHOD} =GET
# Выявляем GET запрос в URL (не POST).
RewriteCond %{REQUEST_URI} ^(.*)/index\.(php|html|htm)$
# URL cодержит index.php в конце.
RewriteRule ^(.*)$ %1/ [R=301,L]
# Удалить index.php из URL.RewriteRule ^index\.html$ / [R=301,L]RewriteCond %{REQUEST_URI} ^(.*)/index\.html$
RewriteRule ^(.*)index\.html$ http://%{HTTP_HOST}/$1 [R=301,L]
[].forEach.call(document.querySelectorAll('[data-background-image]'), function(img) {
console.log(img);
img.setAttribute('style', 'background-image:url('+img.getAttribute('data-background-image')+') !important');
});