admin管理员组文章数量:1425058
is it possible to hide certain checkout filed in woo-commerce when user is logged in ? like i have a checkout field of Email address i do not want my user to see this when the user is logged in Your suggestion would be a great help.
is it possible to hide certain checkout filed in woo-commerce when user is logged in ? like i have a checkout field of Email address i do not want my user to see this when the user is logged in Your suggestion would be a great help.
Share Improve this question asked Jun 22, 2019 at 18:47 Ashiq DipuAshiq Dipu 11 bronze badge1 Answer
Reset to default 1Try :
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
function custom_override_checkout_fields( $fields ) {
if(is_user_logged_in()){
unset($fields['billing']['billing_email']);
}
return $fields;
}
Source : https://docs.woocommerce/document/tutorial-customising-checkout-fields-using-actions-and-filters/
本文标签: functionsWoocommerce checkout field
版权声明:本文标题:functions - Woocommerce checkout field 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745372311a2655783.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论