2016-12-15 63 views
0

我試着搜索一個類似於我在這裏問的問題,而我找不到一個問題。我很抱歉,如果已經有這樣的問題提出並回答。

我試圖做的是用我自己的HTMLCSS更換重力形式進度條。我可以用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 
        (
        ) 

      ) 

    ) 
+0

好吧,我現在通過這樣做得到了我的確認信息: 我想出了我自己的問題來獲取確認信息。我做的是如下: ' $ confirmation_message = $ form ['confirmations']; ($ confirmation_message as $ key => $ value){ foreach($ confirmation_message as $ key => $ value){ error_log(print_r($ value ['message'],true)); } ' 哪打印出我的確認。所以我把它作爲我的'$ confirmation_message'來放置,但是當我完成表單時它仍然沒有顯示確認消息。 –

回答

0

我決定只改變從默認的進度條樣式,並從那裏走。