2017-06-07 81 views
1

我在結帳頁面上的結算字段之前顯示客戶帳單地址的縮寫版本。帳單地址更改在結帳頁面上未更改 - WooCommerce

function show_billing_summary_checkout(){ 
    global $woocommerce; 
    //show short version 
    echo '<b>Your Billing Address</b> <a href="">Change</a><br>'; 
    echo $woocommerce->customer->get_billing_company() . '<br>'; 
    echo $woocommerce->customer->get_billing_first_name() . " " . $woocommerce->customer->get_billing_last_name() . '<br>'; 
    echo $woocommerce->customer->get_billing_email() . '<br>'; 
    echo $woocommerce->customer->get_billing_address_1() . '<br>'; 
    echo $woocommerce->customer->get_billing_city() . ', ' . $woocommerce->customer->get_billing_state() . ' ' . $woocommerce->customer->get_billing_postcode() .'<br>'; 
    echo $woocommerce->customer->get_billing_country() . '<br>'; 
    echo 'Phone: ' . $woocommerce->customer->get_billing_phone() . '<br>'; 

} 
add_action('woocommerce_before_checkout_billing_form', 'show_billing_summary_checkout', 1); 

它的工作......但只有一次。我的意思是,當我在編輯地址頁面下更改了我的賬單信息時,它在結賬頁面上沒有變化。但是,所有更改都顯示在管理面板中,因此此功能中的某些內容不會將更新的信息提供到結帳頁面。此外,結帳頁上的可編輯結算字段中的信息也未更新。

回答

相關問題