0
我试着搜索一个类似于我在这里问的问题,而我找不到一个问题。我很抱歉,如果已经有这样的问题提出并回答。
我试图做的是用我自己的HTML和CSS更换重力形式进度条。我可以用Gravity Forms提供的gform_progress_bar
过滤器来做到这一点。
现在我遇到的问题是一旦我完成我的表单(我使用Ajax与表单),我的确认现在不显示。如果我注释掉过滤器并填写表单,则显示确认。
我试图弄清楚的是为什么我的确认信息不显示,或者如何正确检索。
这里是我有我的代码:
function request_quote_progressbar($progress_bar, $form, $confirmation_message) {
$output = '';
$output .= '<div class="meter animate">';
$output .= '<span class="progress-one">';
$output .= '<span>';
$output .= '<div id="percentage">0%</div>';
$output .= '</span>';
$output .= '</span>';
$output .= '</div>';
$progress_bar = $output;
return $progress_bar;
}
add_filter('gform_progress_bar_2', 'request_quote_progressbar', 10, 3);
现在,当我测试,再我的默认确认不显示,但如果我注释掉显示与形式//add_filter('gform_progress_bar_2', 'request_quote_progressbar', 10, 3);
那么默认的进度条并显示确认信息。
我试过error_log(print_r($confirmation_message, true));
但它会空白。我甚至error_log(print_r($form, true));
只是为了看看一条确认消息在那里,它是,但它是上市这样的:
[confirmations] => Array
(
[58518896a4081] => Array
(
[id] => 58518896a4081
[name] => Default Confirmation
[isDefault] => 1
[type] => message
[message] => Thank you for your request!We are in the process of reviewing your quote and will be in touch with you within the next few days.
[url] =>
[pageId] => 0
[queryString] =>
[disableAutoformat] =>
[conditionalLogic] => Array
(
)
)
)
好吧,我现在通过这样做得到了我的确认信息: 我想出了我自己的问题来获取确认信息。我做的是如下: ' $ confirmation_message = $ form ['confirmations']; ($ confirmation_message as $ key => $ value){ foreach($ confirmation_message as $ key => $ value){ error_log(print_r($ value ['message'],true)); } ' 哪打印出我的确认。所以我把它作为我的'$ confirmation_message'来放置,但是当我完成表单时它仍然没有显示确认消息。 –