【发布时间】:2017-11-09 08:51:40
【问题描述】:
我在结帐页面上的帐单字段之前显示了客户帐单地址的缩短版本。
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);
它起作用了……但只有一次。我的意思是当我在编辑地址页面下更改我的账单信息时,它在结帐页面上并没有改变。但是,所有更改都显示在管理面板中,因此此功能中的某些内容不会将更新的信息拉到结帐页面。此外,结帐页面上的可编辑帐单字段中的信息也没有更新。
【问题讨论】:
标签: php wordpress forms woocommerce checkout