<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
	<channel>
				<title><![CDATA[우커머스 내계정 페이지에 전화번호 추가]]></title>
		<link>https://www.cosmosfarm.com/threads/rss/document/64236</link>
		<description><![CDATA[<p>1. 정확한 제품 또는 플러그인 이름</p>

<p>우커머스</p>

<p> </p>

<p>2. 상세 내용</p>

<p>안녕하세요 </p>

<p>1. 쇼핑몰사이트입니다. 현재 로그인을 카카오, 네이버 연동시켜서 사용중인데 </p>

<p>쇼핑몰에 로그인하고 마이페이지 / 내계정쪽에 보면 전화번호 필드가없어서</p>

<pre>
<code>	&lt;p class="form-row form-row-wide"&gt;
		&lt;label for="reg_billing_phone"&gt;&lt;?php _e( 'Phone', 'woocommerce' ); ?&gt; &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
		&lt;input type="text" class="input-text" name="billing_phone" id="reg_billing_phone" value="&lt;?php if ( ! empty( $_POST['billing_phone'] ) ) esc_attr_e( $_POST['billing_phone'] ); ?&gt;" /&gt;
	&lt;/p&gt;</code></pre>

<p>해당 코드를 삽입하여 필드를 생성했습니다.</p>

<p>전화번호를 입력 후 변경사항저장을 클릭하면 계정정보가 수정되었습니다. 라고뜹니다.</p>

<p>근데 전화번호 필드에는 입력한 정보가 저장되지않더라구요 ㅠ</p>

<p>이럴땐 어떻게해야하나요?</p>

<p> </p>

<p> </p>

<p>3. 확인 가능한 상세 페이지 주소</p>

<p> </p>

<p> </p>

<p>4. 수정한 코드 내역 (있다면)</p>

<p> </p>

<p> </p>]]></description>
		<copyright>Copyright 2026, 코스모스팜</copyright>
				<item>
			<title><![CDATA[안녕하세요~^^

우커머스 myaccount 페이지에서 저장할 때는

따로 추가적인 작업이 필요합니다.

 

아...]]></title>
			<link>https://www.cosmosfarm.com/threads/document/64258</link>
			<description><![CDATA[<p>안녕하세요~^^</p>

<p>우커머스 myaccount 페이지에서 저장할 때는</p>

<p>따로 추가적인 작업이 필요합니다.</p>

<p> </p>

<p>아래 예제코드를 참고하여 적용해보시겠어요?</p>

<pre>
<code>&lt;?php
// 필드 추가
add_action( 'woocommerce_edit_account_form', function(){
	woocommerce_form_field(
		'billing_phone',
		array(
			'type'     =&gt; 'tel',
			'required' =&gt; true,
			'label'    =&gt; 'reg_billing_phone'
		),
		get_user_meta( get_current_user_id(), 'billing_phone', true) // get the data
	);
}, 10, 1);

add_action('woocommerce_save_account_details', function($user_id){
	update_user_meta($user_id, 'billing_phone', wc_clean($_POST['billing_phone']));
}, 10, 1);

// 필수 지정
add_filter('woocommerce_save_account_details_required_fields', function($required_fields){
	$required_fields['billing_phone'] = '휴대전화';
	return $required_fields;
}, 10, 1);</code></pre>

<p>고맙습니다.</p>]]></description>
			<author>스레드봇</author>
			<pubDate>Thu, 27 Apr 2023 09:00:58 +0000</pubDate>
			<category>우커머스(WooCommerce)</category>
		</item>
			</channel>
</rss>