2017-02-14 115 views
0

问题出在结账页面,“您的订单”部分始终显示为灰色,永远加载微调框。Woocommerce wc-ajax返回html响应

我关闭 https ,Cloudflare,所有插件,激活的默认主题,相同的行为仍然存在。

我试图调试发生了什么,当我通过Chrome浏览器开发达到结账页面,网络选项卡:

一个XHR POST请求被发送到/结账/ WC-AJAX = update_order_review

这是这样会很奇怪,这与代码200返回的响应实际上是同一个页面,而不是JSON对象的HTML响应,和效应初探标题是:

Request URL:https://alpha.seniorinafashion.com/checkout/?wc-ajax=update_order_review 
Request Method:POST 
Status Code:200 
Remote Address:104.31.91.108:443 
Response Headers 
cache-control:no-cache, must-revalidate, max-age=0 
cf-ray:3312009e9e431a99-DUS 
content-encoding:br 
content-type:text/html; charset=UTF-8 
date:Tue, 14 Feb 2017 16:47:31 GMT 
expires:Wed, 11 Jan 1984 05:00:00 GMT 
link:<https://alpha.seniorinafashion.com/?p=2724>; rel=shortlink 
link:<https://alpha.seniorinafashion.com/wp-json/>; rel="https://api.w.org/" 
server:cloudflare-nginx 
set-cookie:woocommerce_cart_hash=771886deccd483983b22b6a8ac26f76e; path=/ 
set-cookie:wp_woocommerce_session_d3fe2e799745c6650de3e94ad8c9e5b5=59cfc776e38750ac597b0cc8396dca00%7C%7C1487260661%7C%7C1487257061%7C%7C887c63ae5a0e78a8c86f7622f03cd2d2; expires=Thu, 16-Feb-2017 15:57:41 GMT; Max-Age=169810; path=/ 
set-cookie:woocommerce_items_in_cart=1; path=/ 
set-cookie:woocommerce_cart_hash=771886deccd483983b22b6a8ac26f76e; path=/ 
set-cookie:wp_woocommerce_session_d3fe2e799745c6650de3e94ad8c9e5b5=59cfc776e38750ac597b0cc8396dca00%7C%7C1487260661%7C%7C1487257061%7C%7C887c63ae5a0e78a8c86f7622f03cd2d2; expires=Thu, 16-Feb-2017 15:57:41 GMT; Max-Age=169810; path=/ 
set-cookie:woocommerce_items_in_cart=1; path=/ 
status:200 
x-frame-options:SAMEORIGIN 
x-pingback:https://alpha.seniorinafashion.com/xmlrpc.php 
Request Headers 
:authority:alpha.seniorinafashion.com 
:method:POST 
:path:/checkout/?wc-ajax=update_order_review 
:scheme:https 
accept:*/* 
accept-encoding:gzip, deflate, br 
accept-language:en-US,en;q=0.8 
content-length:836 
content-type:application/x-www-form-urlencoded; charset=UTF-8 
cookie:__cfduid=dcd5da450805c7fb21259f27cb677e8b51487087855; woocommerce_items_in_cart=1; woocommerce_cart_hash=771886deccd483983b22b6a8ac26f76e; wp_woocommerce_session_d3fe2e799745c6650de3e94ad8c9e5b5=59cfc776e38750ac597b0cc8396dca00%7C%7C1487260661%7C%7C1487257061%7C%7C887c63ae5a0e78a8c86f7622f03cd2d2 
origin:https://alpha.seniorinafashion.com 
referer:https://alpha.seniorinafashion.com/checkout/ 
user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 
x-requested-with:XMLHttpRequest 
Query String Parameters 
view source 
view URL encoded 
wc-ajax:update_order_review 
Form Data 
view source 
view URL encoded 
security:47743ef2c2 
payment_method:cod 
country:DE 
state: 
postcode: 
city: 
address: 
address_2: 
s_country:DE 
s_state: 
s_postcode: 
s_city: 
s_address: 
s_address_2: 
post_data:billing_first_name=&billing_last_name=&billing_company=&billing_email=&billing_phone=&billing_country=DE&billing_address_1=&billing_address_2=&billing_postcode=&billing_city=&billing_state=&account_password=&shipping_first_name=&shipping_last_name=&shipping_company=&shipping_country=DE&shipping_address_1=&shipping_address_2=&shipping_postcode=&shipping_city=&shipping_state=&order_comments=&shipping_method%5B0%5D=flat_rate%3A1&payment_method=cod&terms-field=1&_wpnonce=794e840694&_wp_http_referer=%2Fcheckout%2F 
shipping_method[0]:flat_rate:1 
+0

看到这里:http://stackoverflow.com/questions/27023433/disable-ajax-on-checkout-for-woocommerce –

+1

非常感谢,这是一个很好的工作,虐待使用它,直到我找出问题本身 –

+0

你找到了解决方案吗? –

回答

1

我有完全相同的问题,但当我禁用永久链接时它会消失。禁用永久链接后,我得到预期的JSON响应。